Forum

Join Queries that c...
 
Notifications
Clear all

Join Queries that collect variables from Excel and will be used in a sql to gather data from an Oracle Database in one query.

2 Posts
2 Users
0 Reactions
70 Views
(@marcberg)
Posts: 23
Trusted Member
Topic starter
 

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

My Best RegardsOverview-Variables-Excel-and-Queries-2.pngQuery-Current-1.png

 
Posted : 16/05/2021 3:28 pm
(@catalinb)
Posts: 1937
Member Admin
 

Why using separate tables for each parameter?
You can put all parameters in a single table, see image attached.

1-5.jpg

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]),

 
Posted : 19/05/2021 2:04 am
Share: