Skip to content
Datablare
Claude Code Logistics Operations

Carrier delivery performance

24,000 shipments, 80.2% on time and 46 hours from pickup to delivery on average, with on-time rate and cost by carrier and lane.

Data
Synthetic freight demo data (PostgreSQL)
Asked in
Claude Code
Updated
Try this on your data

1 · The brief

What Claude Code was asked

Show me how our deliveries are performing this year: shipments, on-time rate, average delivery time and lost or returned shipments, on-time rate and cost per kg by carrier, the monthly trend, and the lanes with the worst on-time record.

Given exactly like this. Claude Code asked Datablare which tables it could read, wrote the SQL itself, ran each query through Datablare and built the dashboard from what came back.

2 · The dashboard

The dashboard Claude Code built

Carrier delivery performance dashboard: On-time rate by carrier, On-time rate per month, Lanes with the lowest on-time rate, Cost per kg by carrier

Built from 4 read-only queries. Every figure on the dashboard was read from the database through Datablare; nothing was estimated or typed in.

Headline numbers (January–October 2026):

  • Shipments: 24,000 (2026 so far)
  • On time: 80.2% (Delivered by the promised time)
  • Average delivery time: 46 hours (Shipped to delivered)
  • Lost or returned: 7.6% (Share of shipments)

What stands out:

  • On-time rate by carrier: MetroLink 90%; Coastal Freight 58%
  • On-time rate per month: Between 80% and 81% each month
  • Lanes with the lowest on-time rate: Lanes with at least 150 deliveries this year
  • Cost per kg by carrier: SkyFreight Air costs most per kg

The data is a synthetic freight dataset made for this example, so the numbers describe no real company. The queries, the dashboard and the audit entries are real: Claude reached the database only through Datablare, read-only, and every query is on record with the question it served.

3 · What Datablare ran

4 read-only queries, nothing changed

Each query below is copied from the audit log of this run. Datablare checked that it only reads, ran it read-only, and gave only the rows to Claude Code; it never stores them.

  1. Query 1

    Shipments, on-time rate, average delivery hours and exception rate for 2026

    1 row · 77 ms

    SELECT count(*) AS shipments,
           round(avg(CASE WHEN delivered_at <= promised_at THEN 1.0 ELSE 0 END) FILTER (WHERE status = 'delivered'), 4) AS on_time_rate,
           round(avg(extract(epoch FROM delivered_at - shipped_at) / 3600) FILTER (WHERE status = 'delivered'), 1) AS avg_delivery_hours,
           round(avg(CASE WHEN status IN ('lost', 'returned') THEN 1.0 ELSE 0 END), 4) AS exception_rate
    FROM logistics.shipments
    WHERE shipped_at >= TIMESTAMP '2026-01-01'
  2. Query 2

    On-time rate, delivery hours and cost per kg by carrier, 2026

    5 rows · 101 ms

    SELECT c.name AS carrier, c.mode, count(*) AS shipments,
           round(avg(CASE WHEN s.delivered_at <= s.promised_at THEN 1.0 ELSE 0 END) FILTER (WHERE s.status = 'delivered'), 4) AS on_time_rate,
           round(avg(extract(epoch FROM s.delivered_at - s.shipped_at) / 3600) FILTER (WHERE s.status = 'delivered'), 1) AS avg_delivery_hours,
           round(sum(s.cost) / sum(s.weight_kg), 2) AS cost_per_kg
    FROM logistics.shipments s
    JOIN logistics.carriers c ON c.id = s.carrier_id
    WHERE s.shipped_at >= TIMESTAMP '2026-01-01'
    GROUP BY 1, 2
    ORDER BY 4 DESC
  3. Query 3

    Monthly shipments and on-time rate in 2026

    10 rows · 77 ms

    SELECT to_char(date_trunc('month', shipped_at), 'YYYY-MM') AS month, count(*) AS shipments,
           round(avg(CASE WHEN delivered_at <= promised_at THEN 1.0 ELSE 0 END) FILTER (WHERE status = 'delivered'), 4) AS on_time_rate
    FROM logistics.shipments
    WHERE shipped_at >= TIMESTAMP '2026-01-01'
    GROUP BY 1
    ORDER BY 1
  4. Query 4

    The eight busiest-enough lanes (150+ deliveries) with the lowest on-time rate

    8 rows · 70 ms

    SELECT origin_state || ' → ' || dest_state AS lane, count(*) AS deliveries,
           round(avg(CASE WHEN delivered_at <= promised_at THEN 1.0 ELSE 0 END), 4) AS on_time_rate
    FROM logistics.shipments
    WHERE status = 'delivered' AND shipped_at >= TIMESTAMP '2026-01-01'
    GROUP BY 1
    HAVING count(*) >= 150
    ORDER BY 3 ASC
    LIMIT 8
Tables read logistics.carrierslogistics.shipmentss.delivered_at

4 · The audit entry

Who asked what, on record

Every query is recorded with the person who asked, the question in their words and why the agent ran it. Admins see this in the audit log; nothing reaches the database without it.

How the audit log works

query_data_source

via Claude Code

Allowed
Who
The person signed in (hidden on this public page)
Question
Show me how our deliveries are performing this year: shipments, on-time rate, average delivery time and lost or returned shipments, on-time rate and cost per kg by carrier, the monthly trend, and the lanes with the worst on-time record.
Intent
Shipments, on-time rate, average delivery hours and exception rate for 2026
Result
4 queries, 24 rows, read-only

More use cases

All examples
  • Freight spend and cost per kg dashboard: Spend per month by mode, Cost per kg by weight band, Spend by destination state
    Claude Code Logistics Cost & spend

    Freight spend and cost per kg

    ₹44.17M of freight this year at ₹1.8K a shipment; air is 33% of spend, and small parcels cost the most per kg.

    Updated Open

  • Lost and returned shipments dashboard: Lost and returned rate by carrier, Exception rate by origin state, Lost and returned shipments per month
    Claude Code Logistics Risk & compliance

    Lost and returned shipments

    881 shipments lost and 948 returned this year, costing ₹3.33M; Coastal Freight loses about twice as many as other carriers.

    Updated Open

  • E-commerce sales and retention dashboard dashboard: Monthly revenue, Revenue by category, 2026, Lifetime revenue per customer, by channel, Orders per month
    Claude Code E-commerce Executive overview

    E-commerce sales and retention dashboard

    ₹5.21M revenue from 11,897 orders this year, a 57.9% repeat-customer rate, and which channels bring the customers who spend most.

    Updated Open

Build this on your own data.

Connect your database, choose the tables Claude may read, and give it the same brief. Claude is connected in about two minutes.

30 minutes with the founder. Or WhatsApp / [email protected]