Finance Data Analyst Path · Mission 4 of 30Starter

2025 SaaS spend total

SUM with WHERE filter across a JOIN

Back to Finance Data Analyst

The Brief

Sam PatelTreasury Analysttreasury

Quick one for the cash forecast — total SaaS vendor spend YTD 2025. Join `fact_transactions` to `dim_vendors` on vendor_id where category is 'SaaS'. Only posted entries. One number, call the column `total_saas_spend`.

You'll practice

SUMWHEREDate filter

Tables & columns available

fact_transactionsfact10 columns
ColumnTypeKey
txn_idINTPK
txn_dateTEXT
account_idINTFK → dim_accounts
cost_center_idINTFK → dim_cost_centers
vendor_idINTFK → dim_vendors
amountREAL
currencyTEXT
descriptionTEXT
postedINT
posted_dateTEXT
dim_vendorsdim5 columns
ColumnTypeKey
vendor_idINTPK
vendor_nameTEXT
categoryTEXT
countryTEXT
onboarded_dateTEXT

Hints (3)

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

Hint 1

Spend is in the transaction table but the vendor category (SaaS) is in a separate vendor table — connect them to filter by category. Watch out: check that the join key column names actually match on both sides.

Hint 2

Three filters apply simultaneously: vendor category, transaction status, and the calendar year. The year filter needs a cast since txn_date is stored as text.

Hint 3

Wrap everything in a SUM — the result should be a single scalar. The column alias total_saas_spend keeps the cash-forecast cell happy.