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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cleaner WHERE Clause

Hi, 

My question is hopefully a basic one regarding having less script to get to the same thing.  Currently I am doing the following

Load *;

From TableA

WHERE OrderType = "A" AND OrderClass = 71

OR OrderType = "A" AND OrderClass = 85

OR OrderType = "A" AND OrderClass = 91;

Is there a simplier way to write this i.e. in SQL it would be something like

WHERE OrderType = 'A' AND OrderClass IN (71, 85, 91)

Many thanks

C

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan
MVP
MVP

HI

Try like this

Load *;

From TableA

WHERE OrderType = "A" and match(OrderClass,71,85,91)

Hope it helps

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

View solution in original post

2 Replies
MayilVahanan
MVP
MVP

HI

Try like this

Load *;

From TableA

WHERE OrderType = "A" and match(OrderClass,71,85,91)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

LOAD

     *

FROM TableA

WHERE OrderType = "A" AND Match(OrderClass, 71, 85, 91);

The match() in Qlikview will act similarly like In in SQL.  Also you have different variants of Match() like Mixmatch() and WildMatch().

Hope it helps you.

Regards,

Jagan.