Top/bottom N by metric
Top 5 best and bottom 5 worst SKUs by MAPE. Output 10 rows total.
| Column | Type | Key |
|---|---|---|
| actual_id | INT | PK |
| sku_id | INT | FK → dim_skus |
| location_id | INT | FK → dim_locations |
| period_date | TEXT | |
| units_sold | INT | |
| revenue | REAL |
| Column | Type | Key |
|---|---|---|
| forecast_id | INT | PK |
| sku_id | INT | FK → dim_skus |
| location_id | INT | FK → dim_locations |
| version_id | INT | FK → dim_forecast_versions |
| forecast_period_date | TEXT | |
| forecast_generated_date | TEXT | |
| forecast_qty | INT |
Each hint you reveal reduces the XP you can earn. Try the query first.
Two halves stitched together: pick the 5 most accurate and the 5 least accurate SKUs and combine into one result set.
ORDER BY mape ASC and DESC.
sku_id and mape.