RevOps & Sales Analytics Path · Mission 4 of 30Starter

Drop the Closed-Lost deals

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

The Brief

Lina PetrovSales Operations Managersales-ops

The CRO wants a count of every opportunity we're tracking that is NOT Closed-Lost — open pipeline plus Closed-Won, basically. The raw row count in `revops_opportunities` includes lost deals, which inflates the number in her board deck. Give me the count where `stage != 'Closed-Lost'`. Single number.

You'll practice

WHEREFilters

Tables & columns available

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

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.