功率查询 - 格式 - 添加中间的“摘要”文字行

发布于 2025-01-27 02:57:05 字数 1103 浏览 1 评论 0原文

我正在从数据库中转换一些数据,在其中一个步骤的末尾,我需要将其重新格式化以将其作为文档发送给客户。该文档的通常模板具有中间行,其中一列的摘要(只是文本,没有数字)。这意味着从第一个到第二个桌子下面。 是否可以 ?

值1值元数据1值的元数据2分组
第一M11st M2组1
第二个M1 2nd M12nd M2Group
第四2第三M1 3rd M13rd M2Group 3
fortM1 4th M14th M2组4th M2组值1
值1值1值Metadata1值的Metadata 2
Group 2 Group 1
1ST M2 M2 M2 M2 M2 M2 M2 M2 M2 M2 M21st M1M2 M2 M2 M2 M2 M2 M2 m2
第四第四M14th M2
Group2
第二个M12nd M2
组3
第三三分M13rd M2

I am transforming some data from a database, and at the end of one of the step, I need to reformat it for sending it as a document to a client. the usual template for this document has intermediate row with a sort of summary of one of the column (just text, no numbers). It would means going from first to second table here under.
Is it possible ?

value 1value metadata1value's metadata 2grouping
First1st M11st M2group 1
Second2nd M12nd M2group 2
Third3rd M13rd M2group 3
Fourth4th M14th M2group 1
value 1value metadata1value's metadata 2
group 1
First1st M11st M2
Fourth4th M14th M2
group2
Second2nd M12nd M2
group 3
Third3rd M13rd M2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风来 2025-02-03 02:57:05

在PowerQuery中,在分组上尝试以下

IT组,然后将其复制为 value 1 列中的新行,然后扩展

let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"grouping"}, {{"data", each #table( {"value 1"}, {{_[grouping]{0}}}) & _, type table }}),
ColumnsToExpand = List.RemoveLastN(List.Distinct(List.Combine(List.Transform(Table.Column(#"Grouped Rows", "data"), each if _ is table then Table.ColumnNames(_) else {}))),1),
#"Expanded data" = Table.ExpandTableColumn(#"Grouped Rows", "data",ColumnsToExpand ,ColumnsToExpand ),
#"Removed Columns" = Table.RemoveColumns(#"Expanded data",{"grouping"})
in  #"Removed Columns"

In powerquery, try below

It groups on grouping and copies that into a new row in value 1 column before expanding

let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"grouping"}, {{"data", each #table( {"value 1"}, {{_[grouping]{0}}}) & _, type table }}),
ColumnsToExpand = List.RemoveLastN(List.Distinct(List.Combine(List.Transform(Table.Column(#"Grouped Rows", "data"), each if _ is table then Table.ColumnNames(_) else {}))),1),
#"Expanded data" = Table.ExpandTableColumn(#"Grouped Rows", "data",ColumnsToExpand ,ColumnsToExpand ),
#"Removed Columns" = Table.RemoveColumns(#"Expanded data",{"grouping"})
in  #"Removed Columns"

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文