Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ahsanshahzad
Contributor II

How to use where clause for multiple values

Hi Everyone

I have thousands of employees in my database table but I want to fetch only 10 of them.

How can I give the syntax in where clause.

This is my query

SQL select * from Employee

1 Solution

Accepted Solutions
pradosh_thakur
Valued Contributor III

Re: How to use where clause for multiple values

Filter using SQL

SQL select * from Employee

where employee_name in ('a1','a2','a3');

or in  Qlik

load * where match(employee_name,'a1','a2','a3');

SQL select * from Employee;

4 Replies
mdmukramali
Valued Contributor II

Re: How to use where clause for multiple values

Hi Shahzad,

you can try something like this.

SQL select * from Employee

WHERE EmployeeID IN (value1, value2, ...);



Thanks,

Mukram.

pradosh_thakur
Valued Contributor III

Re: How to use where clause for multiple values

Filter using SQL

SQL select * from Employee

where employee_name in ('a1','a2','a3');

or in  Qlik

load * where match(employee_name,'a1','a2','a3');

SQL select * from Employee;

ahsanshahzad
Contributor II

Re: How to use where clause for multiple values

Thank You Mohammad & Pradosh

I was using 'in' but it was giving error. So I thought 'in' will not work in data load editor.

But the problem was, I was  not using single quote (') between employee code.

After using single quote, problem solved

Thank You

pradosh_thakur
Valued Contributor III

Re: How to use where clause for multiple values

Please mark the answers correct and helpful ..