Power Query Nested Table to String

二次信任 提交于 2019-12-24 08:58:35

问题


I have an xml that i'm processing and my output is the below image:

The problem is that i get 2 columns and one has a nested table inside and the other one just the value.

My output need to be something like this:

Can anybody help?


回答1:


Try adding a new custom column like this:

= Table.AddColumn(PreviousStepNameHere, "FREQ Expanded",
      each if Value.Type([FREQ]) = Value.Type("text") then [FREQ]
           else Table.ToList([FREQ]))

And then expand that new column using this code:

= Table.TransformColumns(#"Added Custom", {"FREQ Expanded",
      each if Value.Type(_) = Value.Type("text") then _
           else Text.Combine(List.Transform(_, Text.From), ","), type text})

If your type for non-tables is something else, then adjust accordingly.



来源:https://stackoverflow.com/questions/49781281/power-query-nested-table-to-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!