Parse sensor readings safely with try … otherwise (cold store)
Add a numeric Reading column that is null whenever Raw isn't a number.
- Level
- intermediate
- Time
- ~8 min
- Task
- Build the query
- Access
- Pro
Checking your access…
About this exercise
What you'll practise
Use try … otherwise to handle conversion failures inside an expression.
The scenario, sample data, step list, hints and solution open with Pro. Grading checks your query against hidden data as well as the visible sample, so a query that only fits the sample doesn't pass.
Input
- Log (table)
- Sensor: text
- Raw: text
Expected output columns
Sensor (text), Reading (number (some rows null))