Fix a Changed Type step that breaks two columns (kite shop)
An automatic type step turned customer names into errors and stripped the zeros from order numbers.
- Level
- beginner
- Time
- ~6 min
- Task
- Fix a broken query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Check an automatically added Changed Type step and correct the types it chose.
Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.
Steps
- The starter's
Changed Typestep typesOrderIDas a whole number (0042 becomes 42) andCustomeras a number (every name becomes an error). - Fix that step so
OrderIDandCustomerstay text,Qtyis a whole number andUnitPricea decimal number (en-US). - Output the four columns
OrderID,Customer,Qty,UnitPrice.
Your result must
- OrderID keeps leading zeros (text)
- No error cells in Customer
- Qty and UnitPrice are numbers
Input
- OrderFile (file)
- Text file; first line: OrderID,Customer,Qty,UnitPrice
- Every field is text until you set types
Expected output columns
OrderID (text), Customer (text), Qty (number), UnitPrice (number)
| OrderID | Customer | Qty | UnitPrice |
|---|---|---|---|
| 0001 | Omar Abara | 5 | 14.69 |
| 0002 | Carmen Duarte | 5 | 12.13 |
| 0003 | Goran Varga | 3 | 53.3 |