问题描述
我需要用 PQ 复制多个列,是的,我可以手动完成 10 个步骤或 1 个纠缠步骤和 10 个重复列命令。
虽然我在添加列时遇到了类似的问题:
#"Added Custom" =
Table.AddColumn(#"Changed Type","record",each [
Custom = "DTO",#"Custom.1" = Date.ToText([Accounting Date],"YYYYMMDD"),#"Custom.2" = "SA",#"Custom.3" = "DTO " & Date.ToText([Accounting Date],"yyyy.MM"),#"Custom.4" = null,#"Custom.5" = null,#"Custom.6" = null,#"Custom.7" = null,#"Custom.8" = null,#"Custom.9" = if Text.StartsWith([General Ledger Code],"5") then [Cost Center] else null,#"Custom.10" = null,#"Custom.11" = null,#"Custom.12" = null,#"Custom.13" = if Text.StartsWith([General Ledger Code],"5") then "IF" else null
]),#"Expanded record" = Table.ExpandRecordColumn(#"Added Custom",{"Custom","Custom.1","Custom.2","Custom.3","Custom.4","Custom.5","Custom.6","Custom.7","Custom.8","Custom.9","Custom.10","Custom.11","Custom.12","Custom.13"},"Custom.13"}),
它适用于添加列
但是我在尝试使用以下方法复制时失败了:
#"Duplicated test" = Table.AddColumn(#"Expanded record","duplicated",each [
#"Custom.14" = Table.DuplicateColumn(#"Expanded record","Custom.1 - copy"),#"Custom.15" = Table.DuplicateColumn(#"Expanded record","Custom.3 - copy")
]),#"Expanded duplicated" = Table.ExpandRecordColumn(#"Duplicated test",{"Custom.14","Custom.15"},"Custom.15"}),
展开列后,我收到了整个表格,而不仅仅是 2 个额外的列。
有没有办法像添加列那样简化重复列的操作?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)