Finance Path · Mission 12 of 25Medium

Overspend flags

CASE WHEN for flagging conditions

Back to Finance

The Brief

Priya ShahCFOslack-dm

Before the exec meeting — which cost centers are OVER budget for March 2025? Just the overspenders. Columns: `cost_center_name`, `budget`, `actual`, `overage` (actual minus budget). Sort by overage descending.

You'll practice

HAVINGSubqueriesVariance

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

Reuse the mission-11 shape, but HAVING or WHERE the actual > budget.

Hint 2

Or use a CASE to flag and then filter — either works.

Hint 3

Sort `ORDER BY overage DESC` so the worst appears first.