Create a parameter and use in Custom SQL FROM statement

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.

Hi @Simon ,

Is that what you are looking for?
BG

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.

what is the diff between the county specific tables? is it for multi language or something else?

In each table you have the country related kpi data.

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”.

Yes, thank you, but this would be a workaround :wink:

I will try to have a SQL union and then use the parameter in the where condition.

Ok. I’m happy to hear you result.

1 Like

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? :wink: