February 19, 2021
Hello,
I made several queries that convert an excel value into a variable that can be used in a power excel query that uses a sql-program to collect data from an oracle database.
After changing the value in Excel i need to refresh all the queries separately and that i want to change.
So I want to make one query of the individual queries (that convert the excel values into parameters) that i have at this moment.
In attachment you can find a printscreen of the queries that convert the value in to a parameter and the sheet where you can select the value which will be converted into a parameter.
Also in attachment the syntax of each query which i want to join in one query. The syntax of these queries you can also found below here.
Can someone tell me i this is possible because each individual query results in a table in excel with the wanted parameter value and if it is possible can someone make one query of these several queries so that i know how i can do this for the future.
Current
let
Source = Excel.CurrentWorkbook(){[Name="Cur"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{ {"CurPart", type text}}),
CurName = #"Changed Type"{0}[CurPart]
in
CurName
Previous
let
Source = Excel.CurrentWorkbook(){[Name="Prev"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{ {"PrevPart", type text}}),
PrevName = #"Changed Type"{0}[PrevPart]
in
PrevName
SubCon1
let
Source = Excel.CurrentWorkbook(){[Name="Suba"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{ {"SubConTit1", type text}}),
SubNameA = #"Changed Type"{0}[SubConTit1]
in
SubNameA
SubCon2
let
Source = Excel.CurrentWorkbook(){[Name="Subb"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{ {"SubConTit2", type text}}),
SubNameB = #"Changed Type"{0}[SubConTit2]
in
SubNameB
Thank You In Advance
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Why using separate tables for each parameter?
You can put all parameters in a single table, see image attached.
You will then be able to use any parameter you need:
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Cur=Source{0}[CurPart],
Prev=Source{0}[PrevPart],
Or, don't create a query for each parameter.
You can just refer to that parameter directly in the query you need:
Cur = Text.From(Excel.CurrentWorkbook(){[Name="Cur"]}[Content]{0}[CurPart]),
SubNameB = Text.From(Excel.CurrentWorkbook(){[Name="Subb"]}[Content]{0}[SubConTit2]),
1 Guest(s)