这是用Power Query向导弄的一段代码。我点“高级编辑器”后形成的M代码
let
Spath= Excel.CurrentWorkbook(){[Name="表1"]}[Content]{0}[路径],
源 = Folder.Files(Spath),
删除的列 = Table.RemoveColumns(源,{"Name", "Extension", "Date accessed", "Date modified", "Date created", "Folder Path"}),
已添加自定义 = Table.AddColumn(删除的列, "Custom", each Excel.Workbook([Content])),
#"展开的“Custom”" = Table.ExpandTableColumn(已添加自定义, "Custom", {"Name", "Data", "Item", "Kind", "Hidden"}, {"Custom.Name", "Custom.Data", "Custom.Item", "Custom.Kind", "Custom.Hidden"}),
筛选的行 = Table.SelectRows(#"展开的“Custom”", each ([Custom.Name] = "专项个税扣除")),
删除的其他列 = Table.SelectColumns(筛选的行,{"Custom.Data"}),
#"展开的“Custom.Data”" = Table.ExpandTableColumn(删除的其他列, "Custom.Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10"}, {"Custom.Data.Column1", "Custom.Data.Column2", "Custom.Data.Column3", "Custom.Data.Column4", "Custom.Data.Column5", "Custom.Data.Column6", "Custom.Data.Column7", "Custom.Data.Column8", "Custom.Data.Column9", "Custom.Data.Column10"}),
提升的标题 = Table.PromoteHeaders(#"展开的“Custom.Data”"),
筛选的行1 = Table.SelectRows(提升的标题, each ([纳税人姓名] <> "纳税人姓名"))
in
筛选的行1
在这里面就会出现 #"展开的“Custom”"和#"展开的“Custom.Data”" ,我就是看不懂这个加#有什么意义,或者区别。
请指教,谢谢!
|