Hello,
I'm looking for a way, preferably Power Query, to have a sheet with a table or text file with column names that are visible when loading a spreadsheet.
For example I have a csv with the following columns:
<colgroup><col></colgroup><tbody>
</tbody>
I have created a Sheet with the table:
<colgroup><col><col></colgroup><tbody>
</tbody>
I'm looking for a way, preferably Power Query, to have a sheet with a table or text file with column names that are visible when loading a spreadsheet.
For example I have a csv with the following columns:
Caption |
IP_Address |
AgentPort |
Allow64BitCounters |
AvgResponseTime |
BlockUntil |
BufferBgMissThisHour |
BufferBgMissToday |
|
<colgroup><col></colgroup><tbody>
</tbody>
I have created a Sheet with the table:
Column | Show |
Caption | TRUE |
IP_Address | TRUE |
AgentPort | FALSE |
Allow64BitCounters | FALSE |
AvgResponseTime | FALSE |
BlockUntil | FALSE |
BufferBgMissThisHour | FALSE |
BufferBgMissToday | FALSE |
I would like the Load query to load the Columns that show true. I have the following query to get the list of columns to keep but I don't know how to have the CSV load query remove the extra columns. let Source = Excel.CurrentWorkbook(){[Name="ColumnList"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column", type text}, {"Show", type logical}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Show] = true)), #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Show"}) in #"Removed Columns" I found a stack overflow that shows how to hide a column that I might look at trying to modify with my beginner VBA skills to hide the unwanted columns. https://stackoverflow.com/questions/45110022/excel-macro-hide-columns-based-on-string Possible Addition once working: I might expand it and add a profile column to make it so that specific columns are shown depending on the profile. Reason: I would like to make this so that I can have one workbook that imports the data from a single regularly updated CSV and show different sets of data depending on what I'm working on. Thank you, Kensel |
<colgroup><col><col></colgroup><tbody>
</tbody>