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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use 'In' within where keyword?

Hi All,

Does QV where keyword supports 'In' word like it is in SQL?

For example:

Load * from table where Field in (1,2)

Thanks.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

I'd use one of the following. In case of very few values, Match()

Customers:LOAD *FROM File.qvd (qvd)WHERE Match(CustomerID, 'AAA', 'BBB');


If there are several possibilities or they depend on other field, Exists():

Sales:LOAD *FROM Invoices.qvd (qvd); Customers:LOAD *FROM Customers.qvd (qvd)WHERE Exists(CustomerID); // Will load only those CustomerID present in the Sales table as well


Hope this helps

View solution in original post

3 Replies
Miguel_Angel_Baeyens

Hello,

I'd use one of the following. In case of very few values, Match()

Customers:LOAD *FROM File.qvd (qvd)WHERE Match(CustomerID, 'AAA', 'BBB');


If there are several possibilities or they depend on other field, Exists():

Sales:LOAD *FROM Invoices.qvd (qvd); Customers:LOAD *FROM Customers.qvd (qvd)WHERE Exists(CustomerID); // Will load only those CustomerID present in the Sales table as well


Hope this helps

tresesco
MVP
MVP

You can have a look at EXISTS function or MATCH function.

Regards, tresesco

Not applicable
Author

You can use IN while fetching data from database

for example:

--------------------------------------------

Load

A,B,C

SQL SELECT *
FROM DB.dbo."Table1"
where upper(status)in('ACTIVE','ABC');

--------------------------------------------

You can not use IN while fetching data from QVD