JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I'm working from a PC I can't install screen grabbing software on, I hope I can explain this as clearly as possible:
I have two tables: Data and Headers which are loaded into PQ as connection only:
Data:
Header:
I have a drop-down list which contains unique values from the key column in the Data table
I wish to create an output table for the User to fill in as follows:
3 matching columns from the Data table based on the selected drop-down value AND all rows from the Headers table transposed as column headers next to the 3 matching columns
I'm not sure how to use a Query to filter the data and then further code to create the output by joining, can anyone suggest?
The output table is defined as tbl_Output and I currently use the FILTER function to return the matches from the Data table
TIA,
Jack
I'm working from a PC I can't install screen grabbing software on, I hope I can explain this as clearly as possible:
I have two tables: Data and Headers which are loaded into PQ as connection only:
Data:
Power Query:
let
Source = Csv.Document(File.Contents("XXX"),[Delimiter=",", Columns=42, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Fund Name", type text}, {"Fund Class Name", type text}, {"Fund Class Status Is 'Activated'", type text}, {"Fund Class Start Date", type date},{"Class Type", type text}}),
/* Process data */
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Fund Status] = "Launched") and ([#"Fund Class Status Is 'Activated'"] = "Yes") and ([Income Distribution Treatment] = "Accumulation")),
/* Tidy up */
#"Tidy Up" = #"Filtered Rows"
in
#"Tidy Up"
Header:
Power Query:
let
Source = Excel.CurrentWorkbook(){[Name="tbl_Input_Headers"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Pillar ID", type text}, {"Pillar Label Name", type text}, {"Type", type text}, {"Data Type", type text}, {"Min Value", Int64.Type}, {"Max Value", Int64.Type}, {"Calculation", type any}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Type", "Data Type", "Min Value", "Max Value", "Calculation"})
in
#"Removed Columns"
I have a drop-down list which contains unique values from the key column in the Data table
I wish to create an output table for the User to fill in as follows:
3 matching columns from the Data table based on the selected drop-down value AND all rows from the Headers table transposed as column headers next to the 3 matching columns
I'm not sure how to use a Query to filter the data and then further code to create the output by joining, can anyone suggest?
The output table is defined as tbl_Output and I currently use the FILTER function to return the matches from the Data table
TIA,
Jack