Replace a hand-typed list of IDs with a rule (kite shop)
The query removes cancelled orders by listing this week's cancelled OrderIDs. Make it work every week.
- Level
- intermediate
- Time
- ~6 min
- Task
- Fix a broken query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Recognise steps that only work for today's data and replace them with a rule based on the data.
Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.
Steps
- The starter removes this week's cancelled orders by typing their
OrderIDs into the filter. - Rewrite the filter so it removes every order whose
StatusisCancelled, whatever its ID. - Keep all columns and all other orders (Complete and Pending).
Your result must
- No Cancelled orders
- Complete and Pending orders kept
- No OrderIDs typed into the query
Input
- Orders (table)
- OrderID: text
- Customer: text
- Region: text
- Product: text
- Qty: number
- UnitPrice: number
- OrderDate: text
- Status: text
Expected output columns
OrderID (text), Customer (text), Region (text), Product (text), Qty (number), UnitPrice (number), OrderDate (text), Status (text)
| OrderID | Customer | Region | Product | Qty | UnitPrice | OrderDate | Status |
|---|---|---|---|---|---|---|---|
| 0001 | Sven Silva | East | Box Kite | 9 | 54.95 | 2026-03-01 | Pending |
| 0002 | Mateo Quist | North | Stunt Kite | 1 | 48.63 | 2026-05-19 | Complete |
| 0004 | Omar Uddin | South | Stunt Kite | 6 | 7.98 | 2026-04-09 | Pending |