Operations & Supply Chain Analytics · Mission 13 of 30Medium

Forecast accuracy by SKU last week

Computed accuracy metric — ABS difference / forecast.

The Brief

Iris TanakaDemand Plannerslack-dm

For Friday's S&OP review I need forecast accuracy by SKU for last week (week ending 2026-04-25). Pull from `fact_demand` joined to `dim_skus`. Aggregate units_sold and forecast_units across warehouses per SKU. Accuracy metric (MAPE): `100 * ABS(units_sold - forecast_units) / forecast_units`. Round to 1 decimal. Sort by error DESC so the worst forecasts are at the top.

You'll practice

MAPEABSAggregate-then-divide

Tables & columns available

fact_demandfact6 columns
ColumnTypeKey
demand_idINTPK
sku_idINTFK → dim_skus
warehouse_idINTFK → dim_warehouses
week_endingTEXT
units_soldINT
forecast_unitsINT
dim_skusdim6 columns
ColumnTypeKey
sku_idINTPK
sku_codeTEXT
sku_nameTEXT
categoryTEXT
unit_costREAL
reorder_pointINT

Hints (3)

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

Hint 1

Filter `week_ending = '2026-04-25'`. JOIN to `dim_skus` for sku_name. GROUP BY sku_name with SUM(units_sold) and SUM(forecast_units).

Hint 2

Compute the error AFTER the SUM: `100.0 * ABS(SUM(units_sold) - SUM(forecast_units)) / SUM(forecast_units)`.

Hint 3

Use 100.0 (not 100) to force float division. ROUND(..., 1) for readability. ORDER BY error DESC.