P&L decomposition
| Amount | $ / mile | % of revenue |
|---|
Monthly revenue and gross contribution
Revenue Gross contribution (revenue − fuel − maintenance)
Top 10 customers
By revenue · current period| Customer | Type | Revenue | GC/mi | OTD |
|---|
Top 10 lanes
By revenue · current period| Origin → Destination | Loads | Revenue | GC/mi |
|---|
| Customer | Type | Loads | Miles | Revenue | Share | Trend | $/mi | GC/mi | Fuel recov. | OTD | Detention |
|---|
No customers match the current filter.
| Origin | Destination | Distance | Loads | Revenue | Share | Trend | $/mi | GC/mi | Fuel recov. | OTD |
|---|
No lanes match the current filter.
| Unit | Make / Year | Status | Trips | Miles | Revenue | Trend | MPG | Maint $/mi | Downtime | Incidents |
|---|
No trucks match the current filter.
| Driver | Status | Terminal | Exp | Trips | Miles | Revenue | Trend | MPG | Idle / trip | OTD | Incidents |
|---|
No drivers match the current filter.
Monthly fuel cost vs surcharge billed
Fuel cost Surcharge billed
Purchases by state
Where we fuel| State | Gallons | $ / gal | Cost | Share |
|---|
Top-25 fuel consumers (trucks)
By total fuel cost| Unit | Make / Year | Miles | Gallons | MPG | Cost |
|---|
Top-25 fuel-recovery gaps (customers)
Where surcharge undercollects diesel cost the most| Customer | Type | Loads | Miles | Fuel cost | Surcharge | Recovery | Gap ($) |
|---|
Monthly OTD: pickup vs delivery
Pickup OTD Delivery OTD
Worst facilities by detention
Delivery events · sorted by avg detention| Facility | Type | Location | Events | Avg detention | OTD |
|---|
Top customers by detention
Where customers cost us the most dock time · top 30| Customer | Type | Events | Avg detention | Total detention (hr) | Accessorial billed | OTD |
|---|
Monthly incidents and claim cost
Incidents (count) Claim cost ($)
By type
All-time| Type | Count | Preventable | Claim total |
|---|
Repeat offenders
Top 15 drivers · sorted by incidents| Driver | Terminal | Incidents | Preventable | Claim $ |
|---|
All incidents
| Date | Type | Location | Driver | Unit | Flags | Claim $ |
|---|
Methodology
How every number in this report is computed, what data it comes from, and what is intentionally not included.
Data sources
Fourteen tables in data/logistics/data/:
customers(200)- Customer master: name, contract type (Contract / Dedicated / Spot), credit terms, status, annual revenue potential.
trucks(120)- Tractor master: make, model year, VIN, tank capacity, status, home terminal.
trailers(180)- Trailer master: type (Dry Van / Refrigerated), length, status.
drivers(150)- Driver master: name, hire/term dates, license, CDL class, years experience, home terminal.
routes(58)- Lane master: origin–destination pair, typical distance, base rate, fuel surcharge rate, transit days.
facilities(50)- Pickup/delivery sites: terminals, distribution centers, cross-docks, warehouses with city/state/dock count.
loads(85,410)- Commercial side of each shipment: customer, route, weight, pieces, line haul, fuel surcharge, accessorial.
trips(85,410)- Operational side: driver, truck, trailer, dispatch date, actual miles, gallons used, idle hours. 1:1 with loads.
fuel_purchases(196,443)- Fuel-card transactions: trip, truck, driver, location, gallons, price/gallon, total cost.
maintenance_records(2,921)- Service events: type, odometer, labor + parts cost, downtime hours.
delivery_events(170,821)- Pickup/delivery scheduled vs actual times, detention minutes, on-time flag.
safety_incidents(171)- Incidents: type, fault, injury, vehicle/cargo damage, claim amount, preventability.
driver_monthly_metrics- Pre-aggregated monthly summaries per driver (not currently used).
truck_utilization_metrics- Pre-aggregated monthly summaries per truck (not currently used).
Key formulas
- Total revenue
- line_haul + fuel_surcharge + accessorial — across loads in scope.
- $ / mile
- Total revenue ÷ actual miles driven on those loads.
- Gross contribution (GC)
- Revenue − fuel cost (and − maintenance for trucks). Driver pay, insurance, lease, overhead are not deducted.
- GC / mile
- Gross contribution ÷ miles. The closest thing to lane / customer / truck profitability we can compute from this data.
- Fuel recovery
- Fuel surcharge billed ÷ actual fuel cost. <1.0 means surcharge under-collects diesel; we absorb the gap.
- OTD (On-Time Delivery)
- Share of delivery events arriving at or before scheduled time. Pickup punctuality is reported separately on the Service quality pane.
- Detention
- Minutes spent at the dock past scheduled time, per event. Reported flat (mean) on entity tabs; total hours on the Service quality pane.
- MPG
- Miles ÷ engine fuel gallons used (from
trips.fuel_gallons_used). 5.5–7.5 mpg is typical for class-8 diesel. - Maintenance $/mile
- Total maintenance cost ÷ miles. Above $0.15/mi often indicates an aging asset.
- Idle / trip
- Idle hours ÷ trip count. Long-haul drivers idle overnight for HVAC; >5 hr/trip is high.
- Incidents per million miles
- Industry-standard normalization for cross-fleet comparison: incidents × 1,000,000 ÷ miles.
- Idle cost estimate
- idle_hours × 0.8 gal/hr × avg fuel price. 0.8 gal/hr is the industry assumption for engine idle burn rate.
- Share
- Entity revenue ÷ total fleet revenue (for current period and active customers / all lanes).
Auto-flags on Customers tab
- ⚠ At-risk
- Revenue falling 3 consecutive months and OTD below 50% and fuel recovery below 0.3.
- ★ Premium
- Stable revenue (no falling 3-mo streak) and OTD above 80% and fuel recovery above 0.7.
- ⏸ Dormant
- Status Active but no loads in the most recent 3 months of data.
Period filter
The dataset covers 2022-01 through 2024-12 (36 months). "Last X months" means the trailing X months from the data end (December 2024). All KPIs and sparklines on a tab respond to the period selector.
Drill-down sub-tables (lanes per customer, customers per lane, drivers per truck, etc.) are computed across the full period and clearly labeled. The Service quality and Safety panes are full-period only — period filtering wasn't built for those.
Known limitations
- Customer revenue is unrealistically uniform. The synthetic data was generated with similar load counts per customer (~430 each), giving a coefficient of variation of 6.8% on revenue. Real freight customers follow a Pareto distribution where the top 10 accounts contribute 50–70% of revenue.
- 1 trip = 1 load. No multi-stop or LTL is modelled. In production, trips would carry multiple loads or split a single load across trucks.
- Costs are partial. Driver pay, insurance, lease, and overhead are not in the data, so "gross contribution" is a contribution toward fixed costs, not net margin.
- Deadhead is not directly tracked. No empty-mile field exists. Lane and truck profitability assumes all miles are loaded miles.
- Detention is mean only. We don't have per-event start/end timestamps for dock occupancy beyond the
detention_minutesfield. - Fuel surcharge baseline assumed. Fuel recovery uses the contract
fuel_surcharge_ratedirectly; the true industry comparison would require the DOE/EIA diesel index history.
Build pipeline
Aggregates are pre-computed by Python scripts in scripts/ and saved as JSON in data/logistics/. Re-run any script to refresh the dashboard:
build_customers.py→customers.json(master + monthly + lanes + facts per customer)build_lanes.py→lanes.json(master + monthly + top customers per lane)build_trucks.py→trucks.json(master + monthly + top drivers / lanes per truck)build_drivers.py→drivers.json(master + monthly + top trucks / lanes per driver)build_fuel.py→fuel.json(fleet summary, by-state, by-truck, by-customer-recovery-gap)build_summary.py→summary.json(fleet monthly P&L roll-up)build_service.py→service.json(OTD + detention by month / facility / customer)build_safety.py→safety.json(incidents by month / type / driver / truck + flat list)
The page itself is plain HTML + CSS + vanilla JS, no build step or framework.