将查询嵌套表转换为字符串 [英] Power Query Nested Table to String

查看:109
本文介绍了将查询嵌套表转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个xml,我的输出如下图所示:

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

问题是我得到2列,其中一列具有嵌套表,另一列仅是值。

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:

有人可以帮忙吗?

推荐答案

尝试添加这样的新自定义列:

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.

这篇关于将查询嵌套表转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆