Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to refer to a variable?

Hi All,

I'm looking for a way to refer to a DB_Name in the below WHERE condition (the one below is, obviously, not working). For the data model purpose I'd like to keep the condition within this bit, not load it into another table.

DBs:

SELECT DB_Name FROM Configuration;

Data:

LET NoOfDBs = NoOfRows('DBs');

FOR i = 0 to $(NoOfDBs)-1

LET DB_Name = Peek('DB_Name', $(i), 'DBs');

SELECT

          '$(DB_Name)' AS DB_Name,

     Dim_1

FROM $(DB_Name).Table_1 WHERE $(DB_Name) NOT IN ('DB_1');

NEXT

Regards,

Przemek

10 Replies
Not applicable
Author

That's what I was afraid of, thank you Jonathan.