RevOps & Sales Analytics Path · Mission 4 of 34Starter

Drop the Closed-Lost deals

WHERE + COUNT to exclude a lifecycle bucket from a volume count

Back to RevOps & Sales Analytics

The Brief

Lina PetrovSales Operations Managersales-ops

Quick QBR prep — the board pack needs a single 'total deals we worked this year' number. That's everything in `revops_opportunities` minus Closed-Lost (still-active pipeline plus deals we actually won). Counting Closed-Lost makes the bucket meaningless because dead deals shouldn't count as work-in-flight. Give me the count where `stage != 'Closed-Lost'`. Single number.

You'll practice

WHEREFilters

Tables & columns available

revops_opportunitiesfact11 columns
ColumnTypeKey
opportunity_idINTPK
account_idINTFK → revops_accounts
owner_user_idINTFK → revops_users
nameTEXT
stageTEXT
amountREAL
close_dateTEXT
created_dateTEXT
is_closedINT
is_wonINT
forecast_categoryTEXT

Hints (3)

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

Hint 1

`stage != 'Closed-Lost'` is the filter. You could also write `stage <> 'Closed-Lost'` — same meaning.

Hint 2

`SELECT COUNT(*) FROM revops_opportunities WHERE stage != 'Closed-Lost'` gets you there. One row, one column.

Hint 3

If you're used to filtering lists of stages you might reach for `stage NOT IN ('Closed-Lost')` — same result for one-value lists, but spelled two ways for the same logic. Use whichever reads cleaner to your team.