- let
- 源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
- 更改的类型 = Table.TransformColumnTypes(源,{{"姓名", type text}, {"语文", Int64.Type}, {"姓名2", type text}, {"数学", Int64.Type}, {"姓名3", type text}, {"英文", Int64.Type}}),
- z=Table.SelectColumns(更改的类型,{"姓名","语文"}),
- a=Table.SelectColumns(更改的类型,{"姓名2","数学"}),
- b=Table.SelectColumns(更改的类型,{"姓名3","英文"}),
- h=Table.FromList(List.Distinct(List.Combine({更改的类型[姓名],更改的类型[姓名2],更改的类型[姓名3]})),null,{"姓名"}),
- i=Table.ExpandTableColumn(Table.NestedJoin(h, {"姓名"}, z, {"姓名"}, "a", JoinKind.FullOuter), "a", {"语文"}, {"语文"}),
- l=Table.ExpandTableColumn(Table.NestedJoin(i, {"姓名"}, a, {"姓名2"}, "a", JoinKind.FullOuter), "a", {"数学"}, {"数学"}),
- m=Table.ExpandTableColumn(Table.NestedJoin(l, {"姓名"}, b, {"姓名3"}, "a", JoinKind.FullOuter), "a", {"英文"}, {"英文"}),
- 排序的行 = Table.Sort(m,{{"姓名", Order.Ascending}})
- in
- 排序的行
复制代码 |