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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikhans
Creator
Creator

define one WHERE statement for misc tables

Suppose I have 3 tables, all containing amongst others a company name (fieldname is Company). I want to limit my output to one company: ' ABC'.

What I do now is for each of the tables I insert WHERE(Company='ABC'). Is it possible to make 1 WHERE statement that goes for all tables?

appreciate your response

Hans

4 Replies
sicilianif
Creator II
Creator II

One option is to use the current where clause for the first table, and for the other two use WHERE EXISTS(Company).

For the other two tables, it will only load records where the company exists.

Frank

Not applicable

Hi

You can define the where-statement in a varible that you use in all your 3 load-statements:

LET whereStatement = 'WHERE(Company=' & chr(39) & 'ABC' & chr(39) & ')'; 'chr(39) is the single quote character

LOAD * FROM myFile $(whereStatement);
LOAD * FROM mySecondFile $(whereStatement);
LOAD * FROM myThirdFile $(whereStatement);

/Fredrik

qlikhans
Creator
Creator
Author

Hi Frank,

t.u. for your answer. It helps unexperienced programmers like me to learn the tricks of the trade.

qlikhans
Creator
Creator
Author

Hi Fredrik,

As replied to Frank, I am learning to program on the fly, and comments like yours help me a lot