Finance Path · Mission 9 of 25Easy

Monthly expense by department

Multi-table JOIN with GROUP BY on two dimensions

Back to Finance

The Brief

Mei LinFP&A Managerfpna

Building the 2025 monthly spend trend by department. OpEx only, posted only, all 11 months we have so far. Columns: `department`, `month`, `total_spend`. Sort by department then month.

You'll practice

GROUP BYMulti-JOINDate truncation

Tables available

fact_transactionsdim_accountsdim_cost_centers

Hints (3)

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

Hint 1

Three-table JOIN: `fact_transactions` + `dim_accounts` (for OpEx filter) + `dim_cost_centers` (for department).

Hint 2

Filter `LOWER(account_type) = 'opex'` — there's no casing trap here since the miscase is on Revenue, but the habit matters.

Hint 3

GROUP BY department, month — use `EXTRACT(MONTH FROM txn_date::date)` for the month number.