Procurement & Sourcing Analytics · Mission 3 of 30Starter

Open POs count

COUNT with WHERE on a status column

The Brief

Dario SinghSourcing Managerprocurement-ops

How many POs are still OPEN in `fact_purchase_orders`? Single number, alias `open_po_count`.

You'll practice

COUNTWHERE

Tables & columns available

fact_purchase_ordersfact15 columns
ColumnTypeKey
po_idINTPK
supplier_idINTFK → dim_suppliers
category_idINTFK → dim_categories
contract_idINTFK → dim_contracts
req_dateTEXT
po_dateTEXT
ack_dateTEXT
asn_dateTEXT
gr_dateTEXT
invoice_dateTEXT
qty_orderedINT
qty_receivedINT
unit_priceREAL
contracted_priceREAL
statusTEXT

Hints (3)

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

Hint 1

Filter the row set to one specific status value before counting.

Hint 2

Use COUNT(*).

Hint 3

Alias the column.