let
源 = Folder.Files("D:\桌面\2024成本数据"),
筛选的行 = Table.SelectRows(源, each ([Name] = "工时日报表-成本计算方法整体测试601-2401.xlsx" or [Name] = "工时日报表-成本计算方法整体测试601-2402.xlsx" or [Name] = "工时日报表-成本计算方法整体测试601-2403.xlsx" or [Name] = "工时日报表-成本计算方法整体测试601-2404.xlsx" or [Name] = "工时日报表-成本计算方法整体测试601-2405.xlsx" or [Name] = "工时日报表-成本计算方法整体测试601-2406.xlsx")),
删除的列1 = Table.RemoveColumns(筛选的行,{"Extension", "Date accessed", "Date modified", "Date created", "Attributes"}),
已添加自定义 = Table.AddColumn(删除的列1, "自定义", each Excel.Workbook([Content])),
#"展开的“自定义”" = Table.ExpandTableColumn(已添加自定义, "自定义", {"Name", "Data"}, {"自定义.Name", "自定义.Data"}),
筛选的行1 = Table.SelectRows(#"展开的“自定义”", each ([自定义.Name] = "球铁" or [自定义.Name] = "铸钢" or [自定义.Name] = "锻造")),
#"展开的“自定义.Data”" = Table.ExpandTableColumn(筛选的行1, "自定义.Data", {"Column1", "Column2", "Column3", "Column4", "Column5"}, {"Column1", "Column2", "Column3", "Column4", "Column5"}),
提升的标题 = Table.PromoteHeaders(#"展开的“自定义.Data”", [PromoteAllScalars=true]),
重命名的列 = Table.RenameColumns(提升的标题,{{"锻造", "事业部"}})
in
重命名的列
在哪里设定导入数据行数,要不太多了
|