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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
fdelacal
Specialist
Specialist

where YEAR = '2011' AND YEAR = '2012'

YOU CAN DO

WHERE YEAR> '2011' TOO..

REGARDS

Not applicable
Author

Thanks.  What if i wanted to only pick up years, say, 2006 & 2012 but not the ones in between?

MayilVahanan

HI

where YEAR = '2006' AND YEAR = '2012'

or

use match(Year,'2006','2012') also

Hope it helps

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

where YEAR = '2006' AND YEAR = '2012'
only load thesse yaer.

where YEAR > '2006' AND YEAR < '2012'

will be 2007,, 2008, 2009, 2010, 2011.

Hope it help..

you can add = too..

=<

=>

kruppas78
Contributor III
Contributor III

where YEAR = '2006' OR YEAR = '2012'

So you get both.

The Value in Field YEAR" can not be '2006" AND '2012' in one Row.

Not applicable
Author

Thanks but I'm still struggling to make this work.  I have paste my script below.  I used year in my original posting but its actually a filed called SSS_BATCH_ID i need.  Both of the below return an error message
where "SSS_BATCH_ID" = '726' OR "SSS_BATCH_ID" = '829';

where "SSS_BATCH_ID" = '726' AND "SSS_BATCH_ID" = '829';
MayilVahanan

Hi

Did you try match function?

Like

Where match(SSS_BATCH_ID,726,829)

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

where SSS_BATCH_ID = '726' OR SSS_BATCH_ID = '829';

The quotes say QlikView that it is not a field.

Not applicable
Author

Yes i tried the match function and that didn't work either