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")
Thank you MarcelBeug so much!
Yep, I've got a lot of empty tables on it, but some have values. When I aggregate more then 100 XML files I realy can lose some important information.
Okay, if I got just one value in such tables I can use Table.FirstValue.
But when I have more then one values in such tables how can i expand all of them?
For example in column -> 'tab' then 'infoDtp' then 'ndu'. In this column I've got already one or more values in one such table.
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")
- valeriminakov9 years agoFrequent Visitor
MarcelBeug thank you for your help! :smileyhappy: