我这个应该是最简单易懂,当然,语句啰嗦在所难免
- let
- 源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
- a = Table.FillDown(源,{"列1"}),
- aa=Table.ToColumns(a),
- ab=List.Select(aa,each _{0}<>null),
- ac=List.Split(List.Skip(ab),4),
- ad=List.Transform(ac,each Table.FromColumns({ab{0}}&_)),
- ae=List.Transform(ad,each Table.PromoteHeaders(_)),
- af=List.Transform(ae,each Table.SelectRows(_, each [姓名]<>null and [姓名]<>"姓名")),
- 逆透视的其他列 = List.Transform(af,each Table.UnpivotOtherColumns(_, {"包装车间", "姓名", "时间", "权重"}, "日期", "值")),
- 合并=Table.Combine(逆透视的其他列)
- in
- 合并
复制代码
|