Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

where clause

Hi,

I'm trying to run a query with a where clause saying where "YEAR" = '2011' and '2012'; but i keep getting an error message.  What is the correct way of doing this?

Thanks

13 Replies
Not applicable
Author

Thanks, but the quote marks work when i only ask to pick up say '726' or '829' on their own but not together

MayilVahanan

HI

Please check the attached file..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Qrishna
Master
Master

Hi,

You may try creating a small temporary inline table with all required years.

TEMP_YEAR:

LOAD * INLINE [

Year

2014

2015

2016

];

FACT:

LOAD ID,     

           Fact_Date

FROM $(vQVDSourcePath)Facts.qvd (qvd);

Where Exists (Year,Year(Fact_Date));

DROP TABLE TEMP_YEAR;

This logic filters out all the unwanted years except the inline table's years.

and later dropping the temp table leaves with no extra table in the model.

lawrenceiow
Creator II
Creator II

Might I suggest you try the File Wizard. When you come to the "File Wizard: Options" step you can click the "Where..." button and then make your selections. When you finish you can see how the script was written by the wizard. This will most likely show what went wrong when you tried it.

Most of the answers above are correct:

"SSS_BATCH_ID" = '726' OR "SSS_BATCH_ID" = '829';

or

Match("SSS_BATCH_ID",'726','829')

Both should work so you may find the error is actually something else which the wizard should make apparent to you.