Forum Discussion
JSON data stored in 2 lists. 1 columns header, 1 data. Need to make into a table
- 3 years ago
Hi AshleyWells
Please add a custom column with this. Notice that there is a pair of {} around [ColumnData].
= Table.AddColumn(PreviousStep, "Custom", each #table([ColumnNames],{[ColumnData]}))Then expand the custom table column.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi AshleyWells ,
So does your ColumnData list contain a list for each of the columns in the same order as the ColumnNames?
If so try this
AddTable = Table.AddColumn( PrevStepName, "t", each
Table.FromColumns( [ColumnData], [ColumnNames], MissingField.UseNull )
)
If instead your ColumnData list contains a list for each row, again in the same order as the ColumnNames.
You can try this.
AddTable = Table.AddColumn( PrevStepName, "t", each
Table.FromRows( [ColumnData], [ColumnNames] )
)
I hope this is helpful
Hi
I've tried using your solutions above and the closest I have got is the 2nd one but it's showing this
I've tried to expand the table "t" but it's not showing me any columns
Any ideas?
- m_dekorte3 years ago
Resident Rockstar
Hi AshleyWells,
Could you share an image of the contents of the [ColumnData] column as well?
I've assumed it contained either a list with nested lists (one for each column header) in that case the list count for [ColumnData] and [ColumnHeaders] should be equal. OR it contained a list with nested lists (one for each row in the table) BUT it could also contain a list with nested records...
Can you drill down intoit and let met know what you find?
Thanks!
- AshleyWells3 years agoRegular Visitor
Hi m_dekorte
I have to be carefull with this data as it's sensitive
Both [ColumnData] and [ColumnNames] should hold the same amount of data in each list.
In the bottom 2 rows of the [ColumnData] there is nested data but I don't need this extracting.
Thanks so much for your help so far
Ash
- v-jingzhang3 years ago
Community Support
Hi AshleyWells
Please add a custom column with this. Notice that there is a pair of {} around [ColumnData].
= Table.AddColumn(PreviousStep, "Custom", each #table([ColumnNames],{[ColumnData]}))Then expand the custom table column.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.