Finance Path · Mission 20 of 25Hard

Budget attainment heat map

Dense full-outer aggregation across two dimensions (cost_center × month)

Back to Finance

The Brief

Mei LinFP&A Managerfpna

I need a heat-map-ready dataset for 2025: rows for every (cost_center, month) combo, with `actual`, `budget`, and a status flag ('Over', 'Under', 'On Track' within ±5%, or 'No Data' if either is NULL). OpEx only, posted actuals. One row per CC per month that has at least actuals OR budget.

You'll practice

CASE pivotVariance %Bucketing

Tables available

fact_transactionsfact_budgetsdim_accountsdim_cost_centers

Hints (3)

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

Hint 1

Build two subqueries — one for actuals (by cc, month) and one for budgets (by cc, month) — then FULL OUTER JOIN (or UNION of LEFT+RIGHT if you prefer).

Hint 2

CASE WHEN actual IS NULL OR budget IS NULL THEN 'No Data' WHEN actual > budget * 1.05 THEN 'Over' WHEN actual < budget * 0.95 THEN 'Under' ELSE 'On Track' END.

Hint 3

Expect 96 rows (8 CCs × 12 months; heads up Q4 2025 budgets are partially missing — 'No Data' rows are expected).