Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

"IF (OR..." conditional statement

Hi everyone,

I'm trying to create a calculated dimension using an "if(or..." conditional expression.

The statement is: IF(OR(FieldA = 'Value1', FieldA = 'Value2'),"Value 1,2", "NotValue1,2")

But I get errors. I'm using typical Excel conditional formatting syntax, assuming this would apply.

My objective is to get two cases: a) Value 1,2 and b) NotValue 1,2

and then use these in a pivot table to show summary results.

1 Solution

Accepted Solutions
jsingh71
Partner - Specialist
Partner - Specialist

use this

if(FieldA='Value1' or FieldA='Value2', 'Value1,2', 'NotValue1,2')

View solution in original post

10 Replies
MK_QSL
MVP
MVP

Try something like below.

IF(FieldA = 'Value1' or  FieldA = 'Value2',"Value 1,2", "NotValue1,2"

or

IF(FieldA = 'Value1' or  FieldA = 'Value2','Value 1,2', 'NotValue1,2')

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Try below one

Ex:

Aggr(if(wildmatch(FieldA,'Value1', 'Value2'),'Value 1,2', 'NotValue1,2'),FieldA)

jsingh71
Partner - Specialist
Partner - Specialist

use this

if(FieldA='Value1' or FieldA='Value2', 'Value1,2', 'NotValue1,2')

kumarnatarajan
Partner - Specialist
Partner - Specialist

=Aggr(if(wildmatch(FieldName,'Value1','Value2'),'Value 1,2', 'NotValue1,2'),FieldName)

Not applicable
Author

Thank you Kumar, I am using this but it looks like the portion after the OR group is giving errors

>>   ,"Value 1,2", "NotValue1,2"),FieldA)   <<



jsingh71
Partner - Specialist
Partner - Specialist

can you share your full expression then it will easy to understand where you are getting the error?

MK_QSL
MVP
MVP

I think this is the same answer i have given ....

jsingh71
Partner - Specialist
Partner - Specialist

Will start typing at the same time but by fraction of second you posted before me.

MK_QSL
MVP
MVP

Today is your lucky day.. !