Business intelligence prototype · Trucking & logistics

Turning Trucking Data Into Margin, Visibility, and Faster Decisions

A practical BI framework for integrating TMS, telematics, fuel, maintenance, and financial data into reliable forecasting and operational intelligence.

synthetic loads
726
weeks of history
16
source systems
6

Independent demonstration created by S. Scott Mattes using synthetic data. This prototype is not affiliated with Value Truck and contains no proprietary company information.

Section 01 · The data foundation

Six systems describe every load — none of them agree

“A single shipment may appear in multiple systems with different identifiers, timestamps, mileage values, and cost allocations. Reliable business intelligence begins by resolving those records into one auditable load-level model.”

  • Transportation Management System

    Orders, stops, rates, statuses

  • Telematics & ELD

    GPS, mileage, hours of service

  • Fuel Cards

    Gallons, price, location, unit

  • Maintenance

    Work orders, parts, downtime

  • Financial ERP

    Invoices, payments, GL postings

  • External APIs

    Fuel indexes, weather, FX rates

One shipment, one record

Validated Load-Level
Data Model

Identity resolution · timestamp reconciliation · mileage validation · cost allocation · audit trail

  • Financial Intelligence

    Margin, pricing, leakage

  • Fleet Intelligence

    Utilization, deadhead, dwell

  • Customer Intelligence

    Profitability, service, AR

  • Forecasting & Alerts

    Scenarios, exceptions, risk

Section 02 · High-value analytics

Four use cases where integrated data pays for itself

Each use case runs on the same validated load-level model, so the finance view and the operations view can never drift apart.

Load Margin Intelligence

  • Contribution margin per load
  • Revenue per total mile
  • Unbilled detention and other charges
  • Customer and lane profitability

Decision it supports: Which freight to keep, reprice, or walk away from — decided on measured margin instead of averaged rate-per-mile instinct.

Fleet & Network Optimization

  • Deadhead reduction
  • Tractor and trailer utilization
  • Dwell hot spots
  • Backhaul opportunities

Decision it supports: Where planners should reposition equipment and which lanes need paired backhauls before adding trucks.

Forecasting & Scenario Planning

  • Weekly revenue and margin
  • Fuel-cost sensitivity
  • Capacity scenarios
  • Cash-collection forecasts

Decision it supports: How hiring, fuel-hedging, and credit decisions change next quarter's cash position — tested before committing.

Exception & Risk Monitoring

  • Late-load risk
  • Maintenance risk
  • Data-quality exceptions
  • Invoice and revenue leakage

Decision it supports: Which loads, units, and invoices need intervention today — surfaced automatically instead of discovered at month-end.

Section 03 · Executive dashboard

One filtered view of margin, network, and service

Every figure below recomputes from load-level records as you filter — the same behavior a production semantic layer guarantees. Period Mar 16Jul 5, 2026, as of Jul 10, 2026.

Synthetic demonstration data
Domestic versus cross-border

726 of 726 loads selected

Revenue per Total Mile

$2.74

Linehaul + surcharge + detention ÷ all miles

Cost per Mile

$2.19

Variable operating cost ÷ all miles

Margin per Mile

$0.55

Contribution margin ÷ all miles

Deadhead

12.8%

Empty miles ÷ total miles

On-Time Delivery

94.2%

Delivered ≤ 30 min past appointment

Avg Border Dwell

3.7 h

Cross-border loads only

Revenue-leakage watch: 54 completed loads in this slice sat beyond the 2-hour free window with no detention billed — roughly $8K in unbilled accessorials. See the margin investigation.

Weekly revenue, operating cost, and contribution margin

Billed revenue vs. variable operating cost by pickup week

Margin compresses in the final six weeks as diesel rises faster than surcharge recovery — the gap the investigation below decomposes.

View data table
Week ofRevenueOperating costContribution marginLoads
Mar 16$70,213$56,743$13,47140
Mar 23$78,012$62,367$15,64541
Mar 30$76,647$61,399$15,24742
Apr 6$81,451$64,486$16,96545
Apr 13$81,249$64,143$17,10644
Apr 20$83,671$66,431$17,24043
Apr 27$84,276$66,680$17,59645
May 4$82,677$65,376$17,30043
May 11$92,161$73,102$19,05948
May 18$84,803$67,142$17,66147
May 25$85,673$68,923$16,75146
Jun 1$88,807$71,118$17,68948
Jun 8$80,172$64,024$16,14844
Jun 15$93,335$74,485$18,85047
Jun 22$93,402$76,295$17,10750
Jun 29$106,920$87,066$19,85453

Lane profitability

Revenue per total mile vs. contribution margin % · bubble size = load count

Lanes below the fleet line earn well per loaded mile yet trail on margin — usually empty repositioning, dwell, or border friction.

View data table
LaneRev / total mileMargin %LoadsTotal miles
Toronto, ON → Chicago, IL$2.6516.1%8677,679
Chicago, IL → Winnipeg, MB$2.6113.1%5062,196
Calgary, AB → Denver, CO$3.2329.7%3441,085
Chicago, IL → Toronto, ON$2.6515.6%5448,104
Denver, CO → Calgary, AB$3.0225.5%3339,743
Chicago, IL → Dallas, TX$2.5618.5%3536,580
Dallas, TX → Atlanta, GA$2.8027.1%3731,676
Atlanta, GA → Chicago, IL$2.7625.8%3628,692
Montreal, QC → Toronto, ON$2.5218.0%7528,264
Monterrey, MX → Laredo, TX$2.9118.2%7222,283
Laredo, TX → Dallas, TX$2.4217.6%3920,826
Toronto, ON → Montreal, QC$2.5619.1%4918,452
Dallas, TX → Laredo, TX$2.5421.0%3617,021
Toronto, ON → Detroit, MI$3.1723.0%5313,385
Laredo, TX → Monterrey, MX$2.9618.3%3711,631

Revenue and contribution margin by customer

Ranked by billed revenue for the filtered period

A wide gap between the two bars flags a high-revenue, low-margin relationship worth a pricing or dwell conversation.

View data table
CustomerRevenueContribution marginMargin %Loads
Northgate Retail Group$388,379$62,92116.2%159
Prairie Foods Cooperative$294,913$60,56720.5%84
Great Plains Agri Supply$213,847$48,55422.7%108
Midwest Building Products$167,902$44,44226.5%73
Lakeshore Beverage Co.$82,967$15,21518.3%87
Cascadia Paper & Packaging$73,947$14,18519.2%53
Dominion Auto Components$72,950$14,19119.5%89
TransBorder Metals$68,564$13,61419.9%73

Deadhead percentage by terminal

Empty miles as a share of total miles run

The highlighted terminal runs the most empty miles per mile — a repositioning and backhaul-planning target.

View data table
TerminalDeadhead %Empty milesTotal milesLoads
Laredo, TX19.9%10,86854,740148
Chicago, IL17.0%24,939146,880139
Calgary, AB10.2%8,22780,82867
Dallas, TX9.7%7,47077,389109
Toronto, ON8.8%12,186137,780263

Border dwell distribution

Hours from border-queue arrival to release, cross-border loads

The long right tail is the planning problem: median crossings are fine, but 6+ hour outliers wreck downstream appointments.

View data table
Dwell rangeLoads
0–1 h1
1–2 h35
2–3 h137
3–4 h122
4–5 h54
5–6 h26
6–8 h25
8+ h19

On-time delivery trend

Share of loads delivered within 30 minutes of appointment

View data table
Week ofOn-time %Loads
Mar 1692.5%40
Mar 2397.6%41
Mar 3095.2%42
Apr 693.3%45
Apr 1393.2%44
Apr 2095.3%43
Apr 2793.3%45
May 493.0%43
May 1193.8%48
May 1891.5%47
May 2595.7%46
Jun 197.9%48
Jun 893.2%44
Jun 1593.6%47
Jun 2294.0%50
Jun 2994.3%53

Section 04 · Root-cause investigation

Why did margin decline despite higher revenue?

“Aggregate revenue can conceal the operational reasons margin changes. A useful BI system connects financial variance to operational drivers and identifies which causes are controllable.”

Synthetic demonstration data

Contribution-margin variance, current vs. prior 16 weeks

Illustrative variance decomposition on synthetic data

Revenue grew $420K, but fuel, empty miles, dwell, and unbilled detention consumed $330K of it — leaving +$90K of net contribution improvement. Three of the four drags are controllable.

View data table
DriverImpactRunning totalWhat it captures
Revenue growth+$420K+$420KHigher volume and rate mix vs. prior period
Fuel expense−$145K+$275KDiesel ramp in the final six weeks, net of surcharge
Empty miles−$96K+$179KAdded repositioning, led by the Winnipeg lane
Dwell & waiting−$58K+$121KCustomer dock dwell and paid driver waiting
Unbilled detention−$31K+$90KDetention incurred but never invoiced
Net change+$90K+$90KContribution improvement after operational drags

Recommended actions from the analysis

Review pricing and detention terms for high-dwell customers

Dock dwell above the free window is a real cost — paid driver hours and lost capacity. Reprice it or contract it away.

Improve backhaul planning on lanes with persistent empty repositioning

A lane that pays well loaded can still destroy margin if the trailer comes home empty. Pair headhauls with committed return freight.

Automatically flag completed loads with incurred but unbilled detention

Detention that operations recorded but billing never invoiced is pure leakage — an exception feed catches it the day it happens.

Section 05 · Shared definitions

A KPI glossary everyone reports from

When finance, operations, and sales each compute “on-time” or “margin” their own way, every meeting starts with an argument about whose number is right. A governed glossary — grain, formula, source, owner — is the cheapest fix in analytics. Expand a row for its inclusion and exclusion rules.

KPIBusiness definitionFormulaGrainSource systemsRefreshOwnerDetails
Revenue per total mileAverage revenue earned for every mile the fleet runs, loaded or empty.(Linehaul + fuel surcharge + detention revenue) ÷ total milesLoadTMS · Financial ERPDaily, 06:00Finance BI
Cost per mileVariable operating cost for every mile the fleet runs.Σ variable operating costs ÷ total milesLoadFuel cards · Payroll · Maintenance · ERPDaily, 06:00Finance BI
Contribution margin per loadDollars each load contributes toward fixed cost and profit.Load revenue − load variable costLoadTMS · Fuel cards · Payroll · ERPDaily, 06:00Finance BI
Deadhead percentageShare of total miles run without revenue freight.Empty miles ÷ total milesLoad, aggregated by terminal and laneTelematics/ELD · TMSHourlyOperations BI
On-time deliveryShare of loads delivered within the appointment tolerance.On-time deliveries ÷ delivered loadsLoadTMS · TelematicsHourlyOperations BI
Border dwellHours a cross-border load waits from border-queue arrival to release.Release timestamp − border-arrival timestampBorder-crossing eventTelematics/ELD · Customs broker feedHourlyOperations BI
Tractor utilizationMiles produced per active tractor each week.Total miles ÷ active tractor-weeksTractor-weekTelematics · Maintenance · TMSWeekly, Monday 05:00Fleet BI

Section 06 · Dimensional model

A star schema keeps every report on the same facts

Every measure lives once, at load grain, in the fact table; every business attribute lives once in a conformed dimension. Executive reports become consistent because “customer,” “lane,” and “week” mean exactly one thing — and fast because queries join one narrow fact table to small dimensions instead of scanning raw system extracts.

FactLoad

  • load_key
  • load_id
  • pickup_date_key
  • delivery_date_key
  • customer_key
  • origin_location_key
  • destination_location_key
  • tractor_key
  • trailer_key
  • driver_key
  • terminal_key
  • loaded_miles
  • empty_miles
  • revenue
  • fuel_cost
  • driver_cost
  • toll_cost
  • maintenance_allocation
  • detention_revenue
  • contribution_margin

keys · measures · one row per load

joined to seven conformed dimensions

DimDate

  • date_key
  • calendar_date
  • fiscal_week

DimCustomer

  • customer_key
  • customer_name
  • credit_terms

DimLocation

  • location_key
  • city
  • country

DimLane

  • lane_key
  • lane_name
  • border_flag

DimEquipment

  • equipment_key
  • equipment_type
  • temp_controlled

DimDriver

  • driver_key
  • driver_code
  • domicile_terminal

DimTerminal

  • terminal_key
  • terminal_name
  • region

Consistent

One conformed DimCustomer means finance and operations rank the same customers the same way.

Fast

Narrow fact rows and small dimensions keep executive dashboards interactive without exotic tuning.

Auditable

Every dashboard number traces back through the fact table to source-system records.

Section 07 · Forecasting & scenario planning

A transparent weekly scenario calculator

Every output below is plain arithmetic over the assumptions shown — no black-box model. Move a lever, or load a preset, and trace exactly why the margin changes.

Current network shape at trailing 16-week averages.

Scenario levers

40 loads
10 loads80 loads
$2.74/mi
$2.00/mi$3.60/mi
$3.65/gal
$2.75/gal$5.75/gal
6.6 mpg
5.0 mpg8.5 mpg
12.8%
4.0%30.0%
1.6 h
0.0 h6.0 h
$0.92/mi
$0.60/mi$1.30/mi
Model assumptions (fixed and visible)
  • · Average loaded miles per load: 640 mi
  • · Revenue = revenue per total mile × (loaded miles ÷ (1 − 12.8% baseline deadhead)). The deadhead lever changes miles operated and their cost — not billed freight.
  • · Fuel expense = miles operated ÷ mpg × price per gallon
  • · Driver expense = miles operated × driver cost per mile, plus dwell at $21/hour of paid waiting
  • · Other variable cost (tolls, maintenance, insurance-variable): $0.66/mile operated
  • · Contribution margin excludes fixed overhead by design

Weekly forecast

Forecast revenue (weekly)
$80,440
Forecast fuel expense
$16,236
Forecast total variable cost
$63,965
Forecast contribution margin
$16,475
Contribution margin percentage
20.5%
Change from Base Case margin
±$0

29,358 miles operated per week in this scenario.

From calculator to production forecast

A production forecast would combine historical seasonality, committed customer volume, spot-rate conditions, equipment availability, fuel prices, and accounts-receivable collection patterns — with backtested accuracy reported next to every number, so planners know how much to trust it.

Section 08 · Implementation principles

How this becomes trustworthy in production

Reconcile operations to finance

Operational dashboards should be traceable to financial results. If the margin dashboard can't tie to the P&L, one of them is wrong — and both get ignored.

Define metrics before visualizing them

A shared KPI glossary prevents contradictory reports. Grain, formula, inclusions, and owner are agreed once — then every chart inherits the definition.

Test the data pipeline

Validate uniqueness, completeness, freshness, valid ranges, and referential integrity on every run. A dashboard is only as credible as its worst upstream join.

Automate exceptions, not just reports

Surface late loads, margin leakage, missing invoices, and data-quality failures before they become month-end surprises. Reports describe; exceptions act.

Section 09 · About

Who built this

S. Scott Mattes

Business Intelligence Analyst | Data Engineer

This prototype demonstrates the full path from fragmented operational systems to executive decisions: a governed data model, defined metrics, interactive analysis, root-cause investigation, and transparent forecasting — the working scope of a BI analyst in freight.

  • Python
  • SQL
  • REST APIs
  • ETL and ELT
  • Dimensional Modeling
  • Executive Dashboards
  • Financial and Operational Analytics
  • AI-Assisted Development
optimizewitharrow.com(opens in a new tab)