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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF statement... With two conditions

I want to use a IF Statement which has two conditions to satisfy and on the basis of the two conditions, it should return True or False.

I am using the following expression--->

=IF(age>30 AND Sal>200, 1,0)

however this returning me a False value even if Both the conditions are met !

Can someone tell me where am i going wrong ?

4 Replies
MayilVahanan

Hi

Can you provide a sample file? Without see that scenario, we can't able to give solution. Expression looks ok

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

Instead of using AND trying using a nested if:

If(Age > 30,

     If(Sal > 200, 1,0))

john_duffy
Partner - Creator III
Partner - Creator III

Hello.

The syntax of your if statement looks correct.  I believe if the conditions are met and you want the result to represent 'true', you should replace 1 with -1.

John.

Not applicable
Author

Thanks Jpapador !

It helped

so i want to aggregate the output of the IF condition on a Dimension, and Sum it based on the Dimension selected in the Dimension selection in charts

Something like this -->

=sum(Aggr(if(Age>30,

          if(Sal>200,'1','0')),EMPID]))

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

Where i want to aggregate on EMPID and

Sum based on a Dimension lets say X

Any Idea how to go about it ?