Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rougeherring
Contributor III
Contributor III

Use variable to pull external sql script

I am having trouble including a variable as the name of the file I'd like to load for which includes sql code for creating my QVD's

This code is working:

LET T = 'DM_CASE';

$(T):

LOAD *;

SQL

$(Include=lib://Epic_Scripts_Temp/converted/DM_CASE.sql);

However what I want to do is include $(T) in the reference function to call the text script file. I have over 900 scripts to bring in so I really want to minimize the number of times I have to state each table name. Changing the name to $(T) in the file name doesn't seem to work.

2 Replies
petter
Partner - Champion III
Partner - Champion III

You are right - with a lib: Sense will not accept a $-sign expansion.

There is however a workaround for this:

LET T = 'DM_CASE';

LET vInclude = 'Include=lib://Epic_Scripts_Temp/converted/$(T).sql';

$($(vInclude));

kevinlquinn
Contributor
Contributor

This doesn't seem to be working, was there ever a resolution?