Turn a list of name/value attributes into columns (apparel)
Each product has an attributes list like [{name: colour, value: red}, …]. Make one column per attribute name.
- Level
- advanced
- Time
- ~13 min
- Task
- Build the query
- Access
- Pro
Checking your access…
About this exercise
What you'll practise
Flatten nested key/value pairs: expand the list, expand the records, then pivot.
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
- ProductsJson (file)
- JSON document (parse with Json.Document)
Expected output columns
sku (text), colour (text), size (text), fabric (text)