Ratio of actuals to forecast
Compute attainment = actuals / forecast per SKU (STATISTICAL). Show sku_id and attainment_pct.
| 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.
Forecast attainment is the ratio of total actual to total forecast per SKU. Aggregate both sides separately.
SUM(actual)/SUM(forecast) per sku.
Force float.