Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rougeherring
New Contributor

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.

1 Reply
MVP
MVP

Re: Use variable to pull external sql script

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));

Community Browser