- //Unnamed
- let
- 源 = Excel.CurrentWorkbook(){[Name = "表4"]}[Content],
- 更改的类型 = Table.TransformColumnTypes(源, {{"姓名1", type text}, {"姓名2", type text}}),
- Cols = Table.ColumnNames(更改的类型),
- 自定义2 = List.Accumulate(
- Cols,
- 更改的类型,
- (x, y) =>
- Table.TransformColumns(x, {y, each Text.Combine(List.Sort(Text.Split(_, ",")), ",")})
- ),
- 自定义1 = 自定义2,
- 已添加自定义 = Table.AddColumn(自定义1, "自定义", each if [姓名1] = [姓名2] then "相同" else "不同")[自定义],
- 自定义3 = Table.FromColumns(Table.ToColumns(更改的类型) & {已添加自定义}, Cols & {"比较"})
- in
- 自定义3
复制代码
|