Hello there,
I would appreciate your help on the following.
Detect data type dynamically.
I deal with changing file formats and tables sizes.
When detecting data types I would like to tell PQ to take whatever columns are there and deal with each of them accordingly (instead of hard coded column names as it does by default).
What I do:
1 - I load one file to PQ from folder (there is always just one file but it could be .txt .csv .xls .xlsx or whatever else).
2 - I keep generic column headings when combining the files (by selecting "Do not detect data types"
3 - In the example below the table has 9 columns. But next time it could have 3 or 25 ...
How to do this dynamically?
I would appreciate your help on the following.
Detect data type dynamically.
I deal with changing file formats and tables sizes.
When detecting data types I would like to tell PQ to take whatever columns are there and deal with each of them accordingly (instead of hard coded column names as it does by default).
What I do:
1 - I load one file to PQ from folder (there is always just one file but it could be .txt .csv .xls .xlsx or whatever else).
2 - I keep generic column headings when combining the files (by selecting "Do not detect data types"
3 - In the example below the table has 9 columns. But next time it could have 3 or 25 ...
Rich (BB code):
let
Source = Csv.Document(Parameter1,[Delimiter="#(tab)", Columns=9, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Change Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, _
{"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, _
{"Column7", type text}, {"Column8", type text}, {"Column9", type text}})
in
#"Change Type"
How to do this dynamically?
Last edited: