|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
只会菜单操作,多次合并查询处理,次数需要人为判断:
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
合并的查询 = Table.NestedJoin(源, {"Manager"}, 表1, {"Staff"}, "表1", JoinKind.LeftOuter),
#"展开的“表1”" = Table.ExpandTableColumn(合并的查询, "表1", {"Manager"}, {"Manager.1"}),
合并的查询1 = Table.NestedJoin(#"展开的“表1”", {"Manager.1"}, 表1, {"Staff"}, "表1", JoinKind.LeftOuter),
#"展开的“表1”1" = Table.ExpandTableColumn(合并的查询1, "表1", {"Manager"}, {"Manager.2"}),
合并的查询2 = Table.NestedJoin(#"展开的“表1”1", {"Manager.2"}, 表1, {"Staff"}, "表1", JoinKind.LeftOuter),
#"展开的“表1”2" = Table.ExpandTableColumn(合并的查询2, "表1", {"Manager"}, {"Manager.3"}),
筛选的行 = Table.SelectRows(#"展开的“表1”2", each ([Manager.2] = "GM")),
删除的列 = Table.RemoveColumns(筛选的行,{"Manager.3"}),
重排序的列 = Table.ReorderColumns(删除的列,{"Manager.2", "Manager.1", "Manager", "Staff"})
in
重排序的列 |
|