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:
[TABLE="width: 920"]
<colgroup><col></colgroup><tbody>[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TR]
[TR]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
I have created a Sheet with the table:
[TABLE="width: 984"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Column[/TD]
[TD]Show[/TD]
[/TR]
[TR]
[TD]Caption[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD]IP_Address[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD]AgentPort[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]Allow64BitCounters[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]AvgResponseTime[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]BlockUntil[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]BufferBgMissThisHour[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]BufferBgMissToday[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]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.
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
[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="width: 920"]
<colgroup><col></colgroup><tbody>[TR]
[TD]
Caption
[/TD][/TR]
[TR]
[TD]
IP_Address
[/TD][/TR]
[TR]
[TD]
AgentPort
[/TD][/TR]
[TR]
[TD]
Allow64BitCounters
[/TD][/TR]
[TR]
[TD]
AvgResponseTime
[/TD][/TR]
[TR]
[TD]
BlockUntil
[/TD][/TR]
[TR]
[TD]
BufferBgMissThisHour
[/TD][/TR]
[TR]
[TD]
BufferBgMissToday
[/TD][/TR]
[TR]
[TD]
[/TR]
</tbody>[/TABLE]
I have created a Sheet with the table:
[TABLE="width: 984"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Column[/TD]
[TD]Show[/TD]
[/TR]
[TR]
[TD]Caption[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD]IP_Address[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD]AgentPort[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]Allow64BitCounters[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]AvgResponseTime[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]BlockUntil[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]BufferBgMissThisHour[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]BufferBgMissToday[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]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
[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]