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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
stuwannop
Partner - Creator III
Partner - Creator III

WHERE multiple values in script

Hi All

Assume this is very straightfoward but I can't find the answer.

When running my script with the WHERE clause I can only pull data that matches one criteria e.g.

WHERE Opportunity = 'Won'

How do I run the script on two criteria in the same field - normally I would go:

WHERE Opportunity = 'Won' AND Opportunity = 'Open'

This seems a bit cumbersome, especially if I have a list of values all relating to the same field. Is this the only way of doing it or is there something like WHERE EXISTS or something?

Thanks

Stu

1 Solution

Accepted Solutions
Sokkorn
Master
Master

Hi Stuart,

Match function will do this job.

Ex. Where Match(Opportunity,'Won','Open')

And if you want to use whildcard then use WildMatch() function

Ex. Where WildMatch(Opportunity,'*Won*','*Open*')

Regards,

Sokkorn

View solution in original post

4 Replies
nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

You can used the following expression

WHERE wildmatch('Opportunity','Won','Open');

Regards,

Nirav Bhimani

swuehl
MVP
MVP

LOAD OpportunityMatchField FROM OpportunityMatchTable;

LOAD

     ....

FROM ....

WHERE EXISTS(OpportunityMatchField, Opportunity);

Sokkorn
Master
Master

Hi Stuart,

Match function will do this job.

Ex. Where Match(Opportunity,'Won','Open')

And if you want to use whildcard then use WildMatch() function

Ex. Where WildMatch(Opportunity,'*Won*','*Open*')

Regards,

Sokkorn

stuwannop
Partner - Creator III
Partner - Creator III
Author

Thanks very much everyone that's really helpful.

Cheers.