let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
分组的行 = Table.Group(源, {"工单", "辅助列"}, {"所有内容", each _}),
a = {"Unaccountable,Assembly,SCRAP","AssyCollectedLoss,Assembly,SCRAP","AssemblyQCLoss,Assembly,SCRAP","MoldingQC_Loss,Molding,SCRAP","RBI_Open,RBI,SCRAP"},
遍历表 = Table.TransformColumns(分组的行,{"所有内容",each if List.MatchesAny(a,(x)=> x=[辅助列]{0}) then Table.LastN(_,1) else _ }),
删除的列 = Table.RemoveColumns(遍历表,{"辅助列"}),
#"展开的“所有内容”" = Table.ExpandTableColumn(删除的列, "所有内容", {"日期时间", "类型", "数量", "料号", "站点", "处置", "辅助列"}, {"日期时间", "类型", "数量", "料号", "站点", "处置", "辅助列"}),
更改的类型 = Table.TransformColumnTypes(#"展开的“所有内容”",{{"日期时间", type datetime}})
in
更改的类型 |