Operations & Supply Chain Analytics · Mission 7 of 30Easy

On-time delivery rate per supplier

Conditional aggregation (CASE + AVG) for a percentage rate.

The Brief

Raj PatelProcurement Managerslack-dm

For the supplier review I also need on-time delivery rate per supplier. On-time = `actual_arrival <= expected_arrival`. Use only received POs (skip in-flight and cancelled). Return supplier_name and on_time_pct (rounded to 1 decimal). Sort highest to lowest.

You'll practice

CASE + AVGConditional aggregation

Tables & columns available

fact_purchase_ordersfact12 columns
ColumnTypeKey
po_idINTPK
po_numberTEXT
sku_idINTFK → dim_skus
supplier_idINTFK → dim_suppliers
warehouse_idINTFK → dim_warehouses
order_dateTEXT
expected_arrivalTEXT
actual_arrivalTEXT
qty_orderedINT
qty_receivedINT
unit_costREAL
statusTEXT
dim_suppliersdim6 columns
ColumnTypeKey
supplier_idINTPK
supplier_nameTEXT
countryTEXT
lead_time_target_daysINT
on_time_target_pctREAL
is_activeINT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

JOIN `fact_purchase_orders` to `dim_suppliers`. Filter `status = 'received'`.

Hint 2

Per-row on-time flag: `CASE WHEN actual_arrival <= expected_arrival THEN 1.0 ELSE 0.0 END`. Then AVG that and multiply by 100.

Hint 3

GROUP BY supplier_name, ROUND(AVG(...) * 100, 1) AS on_time_pct, ORDER BY on_time_pct DESC.