Cost per mile by route

Why ask this?

A fleet planner comparing routes needs cost per mile across all trips on a route. Trip mileage determines how much each trip contributes.

Start with the sample data

Open source.csv. In the first row of source.csv, Route = Red, Cost = 8, Miles = 0.50.

What to say

Make a bar chart of average cost per mile by route. Divide total cost by total miles, ignoring rows with zero miles.

Processing time

Recorded audio to chart ready
5.37 s
Transcript to chart ready
0.55 ms

One local replay from recorded audio through transcription and native chart data preparation. Recording time and screen painting are excluded.

See the transcript in the composerRecorded transcript entered in the native composer

How the canvas produces the result

  1. CSV Input · Read the sample records

    source.csv supplies 4 rows. These records are the inputs to the next step.

  2. Measure Filter · Keep the requested rows

    The filter uses Miles > 0 in keep mode. 3 rows remain including Red.

  3. Aggregate · Sum Cost, Sum Miles for each Route

    If a category appears more than once, its records contribute to one result. The first output row contains Route = Red, sum_Cost = 15, sum_Miles = 3.

  4. Math · Calculate Average cost per mile

    Apply [sum_Cost] / [sum_Miles] to each input row. Set Decimal places to 2 to round the result. The first row yields 5.

  5. Charts · Draw the bar chart

    Use Route for the categories and Average cost per mile for the plotted values.

Native n0is canvas for Cost per mile by route

The chart

Workflow result in n0is
RouteAverage cost per mile
Red5
Blue20

How to use the result

For Route Red, the sample reports Average cost per mile of 5.

Synthetic test audio. Screenshots from the recorded workflow in n0is.