Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load several times from a list

I need to load data from several sources, but the clause WHERE it's the same.

[Source1]:

     LOAD * FROM Table01

     WHERE Match(CodeArea,101,106,109,125,129,131) > 0;

[Source2]:

     LOAD * FROM Table02

     WHERE Match(CodeArea,101,106,109,125,129,131) > 0;


[Source3]:

     LOAD * FROM Table03

     WHERE Match(CodeArea,101,106,109,125,129,131) > 0;


I can make a variable with the values (101, 106, 109, 125, 129, 131)? And use it in the script?


Let AreaValues = '101, 106, 109, 125, 129, 131';

[Source4]:

     LOAD * FROM Table03

     WHERE Match(CodeArea,AreaValues) > 0;


Thanks

5 Replies
MK_QSL
MVP
MVP

For i = 1 to 3

Load * From Table$(i)

WHERE Match(CodeArea,101,106,109,125,129,131) > 0;

Next i

its_anandrjs
Champion III
Champion III

Create a variable like

Let AreaValues =Concat(CodeArea,',');

its_anandrjs
Champion III
Champion III

Then use in a code like

Let AreaValues =Concat(CodeArea,',');

[Source1]:

     LOAD * FROM Table01

     WHERE Match(CodeArea,AreaValues) > 0;

[Source2]:

     LOAD * FROM Table02

     WHERE Match(CodeArea,AreaValues) > 0;


[Source3]:

     LOAD * FROM Table03

    WHERE Match(CodeArea,AreaValues) > 0;


Not applicable
Author

Anand, and where can I write the values 101,106,109,125,129,131?

Thank.

its_anandrjs
Champion III
Champion III

Create one inline table like below and you can create many according to your match criteria.

Eg:-

Load * Inline[

MatchAreaValues

101

106

109

125

129

131

];


Let AreaValues =Concat(MatchAreaValues,',');


And then use

[Source1]:

     LOAD * FROM Table01

     WHERE Match(CodeArea,AreaValues) > 0;

[Source2]:

     LOAD * FROM Table02

     WHERE Match(CodeArea,AreaValues) > 0;


[Source3]:

     LOAD * FROM Table03

    WHERE Match(CodeArea,AreaValues) > 0;