Fix a step that silently skips the cleaning step (kite shop)
The query runs, but its totals are split across " north" and "North": the Group step reads Source instead of the cleaned step.
- Level
- intermediate
- Time
- ~7 min
- Task
- Fix a broken query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Spot a step that references the wrong earlier step even though the query doesn't fail.
Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.
Steps
- The starter cleans
Region(trim, then Capitalize Each Word) and then groups, but the grouping step refers toSource, so the cleaning is ignored. - Fix the reference so the totals are grouped by the cleaned Region.
- Output
RegionandTotal Qty(sum of Qty), one row per clean region.
Your result must
- One row per clean region (e.g. North)
- Total Qty sums every order of that region
- Columns: Region, Total Qty
Input
- Orders (table)
- OrderID: text
- Customer: text
- Region: text
- Product: text
- Qty: number
- UnitPrice: number
- OrderDate: text
- Status: text
Expected output columns
Region (text), Total Qty (number)
| Region | Total Qty |
|---|---|
| East | 25 |
| South | 9 |
| North | 6 |