- let
- 源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
- f=(tab)=>
- [ a = Table.AddColumn(tab, "a", each [进出标志]&"1"),
- b = Table.Pivot(a, List.Distinct(a[进出标志]), "进出标志", "通行时间"),
- c = Table.Pivot(b, List.Distinct(b[a]), "a", "读头编号"),
- d = Table.Group(c, {"工号", "Day"}, {{"出", each List.Max([出]), type nullable datetime}, {"读头编号1", each List.Max([出1])}, {"进", each List.Max([进]), type nullable datetime}, {"读头编号2", each List.Max([进1])}, {"类型", each List.Max([类型])}})
- ][d],
- s=Table.Combine(List.Transform(Table.Split(源,2),(x)=>f(x)))
- in
- s
复制代码 |