Forum Discussion
Expand value from table
- 9 years ago
Even better:
#"Expanded g_v" = Table.TransformColumns(#"Expanded ts_info", {{"g_v", each if _ is table then Table.FirstValue(_, null) else _}})No need for "try ... otherwise", as a default value can be supplied as second argument that will be returned if the table is empty.
- 9 years ago
If all tables are either empty or have 1 column, then you can:
first transform all values to lists and
next use the expand button to expand the column with embedded lists.
Generated code:
#"Lists from ndu" = Table.TransformColumns(#"Expanded infoDtp",{{"ndu", each if _ is table then Table.ToList(_) else {_}}}), #"Expanded ndu" = Table.ExpandListColumn(#"Lists from ndu", "ndu")
Yep v-sihou-msft, this file.
This is open data from russian traffic accident statistics. I guesse it may be a lot of bugs because it takes from differents sources.
To find my example first you need to expand columns: 'tab' then 'infoDtp' then 'ts_info' and finaly it will be column 'g_v' (year of manufactured).
Thank You!
After your steps, there are 8 tables in column g_v, of which 7 are empty.
You can expand the table with the following code (In which #"Expanded ts_info" is the name of the previous step):
#"Expanded g_v" = Table.TransformColumns(#"Expanded ts_info", {{"g_v", each if _ is table then try Table.FirstValue(_) otherwise null else _}})