E-commerce, quick commerce and manufacturing all depend on moving goods reliably. Logistics analytics is about finding where time and money are lost between the warehouse and the customer.
The flow
Order placed โ picked and packed in the warehouse โ dispatched โ in transit through hubs โ out for delivery โ delivered (or failed, retried or returned).
Every step has timestamps, and most KPIs come from comparing them.
Delivery KPIs
- On-time delivery rate: delivered by the promised date or time รท total delivered.
- SLA breach rate: share of shipments missing the agreed delivery window.
- First-attempt delivery rate: delivered on the first attempt. Failed attempts cost money and annoy customers.
- RTO (return to origin) rate: shipments returned to the seller, often from failed delivery or refused cash-on-delivery orders.
- Average delivery time, plus percentiles such as the 90th, which show the slow tail.
Warehouse KPIs
- Same-day dispatch rate: orders received before the cut-off that leave the same day.
- Order picking accuracy.
- Order cycle time: order placed to dispatch.
- Backlog: orders waiting at the end of a shift.
Inventory KPIs
- Inventory turnover: how many times stock is sold and replaced in a period.
- Days of inventory on hand.
- Stockout rate: how often items are unavailable when ordered.
- Fill rate: share of ordered quantity shipped from available stock.
Cost KPIs
- Cost per shipment or per kilometre.
- Cost of failed deliveries and RTO.
Analysing SLA breaches
- Calculate breach rate by city, pin code, hub, courier partner, time slot and day of week.
- Find where the delay happens: warehouse, first hub, last mile.
- Check capacity: orders per rider, per shift, per hub against breaches.
- Look at special days: sales events and festivals.
- Recommend changes: rider allocation, cut-off times, partner mix.
SELECT hub, courier,
COUNT(*) AS shipments,
ROUND(100.0 * AVG(CASE WHEN delivered_at > promised_at THEN 1.0 ELSE 0 END), 1) AS breach_pct
FROM shipments
WHERE delivered_at IS NOT NULL
GROUP BY hub, courier
HAVING COUNT(*) >= 50
ORDER BY breach_pct DESC;The HAVING filter avoids drawing conclusions from very small groups.
Portfolio projects
See the logistics projects page. Retail returns are closely linked; see retail and e-commerce KPIs.
Practise what you just read
Reading helps; writing the code yourself is what sticks. Start here: