Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

Where condition help

Hi Experts,

Can any one please help me on below requirement.

I have a table like below

Table1:

Load

Name,

Status

ID,

DATE

From ....

Here how to add the where condition to load only these records.

Name = 'P' , 'A', 'V' and Status = 'Y'

I have tried like below

Table1:

Load

Name,

Status

ID,

DATE

From ....

where Name = 'P'  and Name= 'A' and Name = 'V'  and Status = 'Y'

Group by ID,DATE;


but fetching 0 records only.

Please let me know am I missed any syntax in where condition.


Thanks in advance.



1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

I think you mean

Where (Name = 'P' Or Name= 'A' Or Name = 'V')  And Status = 'Y'



Which could also be written

Where Match(Name, 'P', 'A', 'V')  And Status = 'Y'


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

I think you mean

Where (Name = 'P' Or Name= 'A' Or Name = 'V')  And Status = 'Y'



Which could also be written

Where Match(Name, 'P', 'A', 'V')  And Status = 'Y'


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ahmar811
Creator III
Creator III

Try

Table1:

Load

Name,

Status

ID,

DATE

From ....

where (Name = 'P'  or Name= 'A' or Name = 'V')  and Status = 'Y'

Group by ID,DATE;


I hope this will help you



big_dreams
Creator III
Creator III

use

where match(Name,'P','A','V')

and status='Y'

Regards,

big_dreams
Creator III
Creator III

and one more thing why you required group by function, if you are not using any aggregation function.??

Regards,

max

jonathandienst
Partner - Champion III
Partner - Champion III

Agreed - there is no need for the Group By. In fact Qlik will even throw an error for a Group By without aggregation or with only some of the fields listed.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
trdandamudi
Master II
Master II

May be as below:

Where Match(Name, 'P', 'A','V')  and Status = 'Y'