|
用函数会比较复杂,改用PQ做了一个。let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
删除的顶端行 = Table.Skip(源,1),
提升的标题 = Table.PromoteHeaders(删除的顶端行, [PromoteAllScalars=true]),
逆透视的其他列 = Table.UnpivotOtherColumns(提升的标题, {"姓名"}, "属性", "值"),
按分隔符拆分列 = Table.SplitColumn(Table.TransformColumnTypes(逆透视的其他列, {{"值", type text}}, "zh-CN"), "值", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), {"值.1", "值.2", "值.3", "值.4"}),
更改的类型1 = Table.TransformColumnTypes(按分隔符拆分列,{{"值.1", type time}, {"值.2", type time}, {"值.3", type time}, {"值.4", type time}, {"属性", type datetime}}),
逆透视的其他列1 = Table.UnpivotOtherColumns(更改的类型1, {"姓名", "属性"}, "属性.1", "值"),
删除的列 = Table.RemoveColumns(逆透视的其他列1,{"属性.1"}),
更改的类型 = Table.TransformColumnTypes(删除的列,{{"属性", type date}}),
合并的列 = Table.CombineColumns(Table.TransformColumnTypes(更改的类型, {{"属性", type text}, {"值", type text}}, "zh-CN"),{"属性", "值"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"时间")
in
合并的列
考勤表调整格式.rar
(16.83 KB, 下载次数: 81)
|
|