Simon
October 23, 2023, 11:59am
1
Hi together,
is it possible to use a country parameter in a custom SQL FROM Statement?
The goal is to load only from the country specific table.
Example:
Parameter: Country = de
Custom SQL: SELECT * FROM f_table_<<$Country>>
Executed SQL: SELECT * FROM f_table_de
Thank you for the support.
ErikG
October 23, 2023, 12:46pm
2
Hi @Simon ,
Is that what you are looking for?
BG
Simon
October 23, 2023, 12:52pm
3
Hi Erik,
yes, but it doesn`t work in a FROM statement. I get an error message.
In a WHERE statement the parameter works fine.
ErikG
October 23, 2023, 12:57pm
4
what is the diff between the county specific tables? is it for multi language or something else?
Simon
October 23, 2023, 1:58pm
5
In each table you have the country related kpi data.
ErikG
October 23, 2023, 2:03pm
6
The column names are the same?
Can you merge the table and add a column “country”? Then you could use the parameter in the “where”.
Simon
October 23, 2023, 2:31pm
7
Yes, thank you, but this would be a workaround
I will try to have a SQL union and then use the parameter in the where condition.
ErikG
October 25, 2023, 3:19pm
8
Ok. I’m happy to hear you result.
1 Like
Simon
November 7, 2023, 3:14pm
9
I did several tests. Dataset parameters are good in a “WHERE” condition. They can improve the speed for the Direct Query.
For some use cases, it would be good to use the dataset parameter also in the “FROM” statement (like a variable).
I think this would be a new feature request, right?