|
简简单单分个组不就搞定了么?
- let
- Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TcvRCQAgCEXRXfwO8UXbhHtk02cipV/XU85JEIAakbbo/noIanOsoUHo/6t3Pl8t9JXzbvmwmeutSrx3ai6qBw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [会计科目代码 = _t, 上级科目代码 = _t]),
- Grouped = Table.Group(Source, "会计科目代码", {"grp", Table.Last}, 0, (x,y) => Byte.From(not Text.Contains(y,x))),
- #"Expanded grp" = Table.ExpandRecordColumn(Grouped, "grp", {"会计科目代码"}, {"末级科目代码"})
- in
- #"Expanded grp"
复制代码
|
|