Power Query Nested Table to String

2019-08-04 05:15发布

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

Print1

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:

Print2

Can anybody help?

1条回答
我想做一个坏孩纸
2楼-- · 2019-08-04 05:32

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.

查看更多
登录 后发表回答