/fm/fleet/analytics.
Overview
The Fleet Analytics page usesuseFleetTrendData for trend data and computes per-vehicle stats by querying fm_fleet_mileage_logs, fm_fleet_fuel_logs, and fm_fleet_trips directly via Supabase for each vehicle. A Period selector controls the analytics timeframe: Last 30 Days, Last 90 Days, Last 6 Months, Last Year. Five KPI stat cards display: Total Miles, Total Fuel Cost, Avg MPG, Cost per Mile, and Total Trips. Two charts are rendered: FleetMileageTrendChart and FleetFuelCostChart (both use trend data). A FleetVehicleComparisonTable shows per-vehicle: vehicle number, make, model, year, total miles, total fuel cost, avg MPG, cost per mile, and trip count.
Who it’s for
Requires permissionfm.dashboard.view.
Before you start
- Fuel logs, trip logs, and mileage logs must be recorded for meaningful analytics.
- The period selector defaults to the last 6 months.
Steps
1
Open Fleet Analytics
Navigate to
/fm/fleet/analytics via the Fleet menu.2
Select a period
Use the Period dropdown to choose 30 days, 90 days, 6 months, or 1 year.
3
Review KPI cards
Check Total Miles, Total Fuel Cost, Avg MPG, Cost per Mile, and Total Trips.
4
Analyze trend charts
Review the Mileage Trend and Fuel Cost trend charts.
5
Compare vehicles
Scroll to the Vehicle Comparison table to compare per-vehicle performance metrics.
Key concepts
- Cost per mile —
totalFuelCost / totalMilesper vehicle for the selected period. - Trend period options —
30d,90d,6m,1y(values fromTrendPeriodtype). - Vehicle comparison data — aggregated from three separate Supabase queries per vehicle run in parallel.
Related
Facilities & Inventory
Facilities & Inventory core overview.
Governance & parity
Documentation coverage and governance.
This page documents shipped product behavior. It is not medical, legal, or
billing advice. Verify against your organization’s policies and applicable
regulations before using it for clinical, compliance, or billing decisions.
Protected health information (PHI) shown in the product is governed by your
tenant’s access controls and is never exposed in this documentation.
Documentation sources
Documentation sources
- src/routes/fm.tsx
- src/cores/fm/pages/FleetAnalyticsPage.tsx