Forum Discussion
LoremIpsum
8 years agoRegular Visitor
Import Data from Folder with Files That Have Additional Headings
I need to import data from 2 groups of files that have the same structure EXCEPT 1 group of files has additional columns that I need. Group 1 has 4 relevant data columns. Group 2 has the same 4 r...
LoremIpsum
8 years agoRegular Visitor
I had tried your tip before posting without success. Here is what I get back: [Expression.Error] The key didn't match any rows in the table.
Another problem I forsee is my first file is always the shorter version, and the filenames change every day so I can't select the longer version file.
MarcelBeug
Community Champion
8 years agoIf all column names are known, then you can adjust the Transform Sample query and use Table.SelectColumns(Name-of-previous-step,list-with-column-names,MissingField.UseNull).
If any of the columns is missing, then the column will be created with null values.
E.g., if your previous step is "Source" and your required columns are Column1 and Column2:
SelectColumns = Table.SelectColumns(Source,{"Column1","Column2"),MissingField.UseNull)