Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Contributor II

Where IN () - Load the values from .txt file

Hi All,

What is the best way to handle this - I have an SQL server query like Where ChangeName IN ('A','B','C') - I have around 9500 to 10,000 values hard coded - I want to move these to an .txt file and use the values from the text file

tried something like this based on some other post

WHERE ChangeName IN ($Include='path to the text file')  - This is not working - it is throwing an error

what could be the best approach considering the IN values may be around 10 to 15,000

Thanks a lot

4 Replies
Valued Contributor II

Re: Where IN () - Load the values from .txt file

Try this -

Load distinct ChangeName

from YourTextFile;


Load * from YourtableName  where Exists(ChangeName);

Contributor III

Re: Where IN () - Load the values from .txt file

try below:

You can create a Mapping table.


Mapping load     Where_Field , 1 as ID

From Your_Where Clause_file.xls


load *

From Data.qvd

where  Applymap('M_Where_Clause', Where_Field ,0) = 1;

//**The Where_Field should be made available in the Fact_table.


Re: Where IN () - Load the values from .txt file

I think best way would be the wild match qualifier as below

Load * from abc.txt Where wildmatch(ChangeName, '*A*','*B*','*C*')

i believe effective than IN function.

Contributor II

Re: Where IN () - Load the values from .txt file

Thank you Neelam, Vishnu -  I was trying to get this done at the SQL Select level - These are good alternate approaches - thanks for your time - actually the below is working in SQL Select




WHERE ChangeNumber In ( $(Must_Include=full_path) ) ;

this worked without any error