问题
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