Finance Path · Mission 19 of 25Hard

Cost center rank by 2025 OpEx

RANK() window function on aggregated data

Back to Finance

The Brief

Priya ShahCFOslack-dm

Quick exec view — rank cost centers by 2025 OpEx spend YTD. Columns: `cost_center_name`, `total_opex`, `rank`. Highest spender is rank 1. Posted only.

You'll practice

RANK()Window functionsFiltering

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

Aggregate per cost center: SUM(amount) WHERE OpEx and 2025 and posted.

Hint 2

Apply `RANK() OVER (ORDER BY total_opex DESC) AS rank`.

Hint 3

8 rows — every cost center has some 2025 OpEx.