Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Valued Contributor

Re: "IF (OR..." conditional statement

use this

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

10 Replies
MVP
MVP

Re: "IF (OR..." conditional statement

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
Valued Contributor

Re: "IF (OR..." conditional statement

Hi,

Try below one

Ex:

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

jsingh71
Valued Contributor

Re: "IF (OR..." conditional statement

use this

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

kumarnatarajan
Valued Contributor

Re: "IF (OR..." conditional statement

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

Not applicable

Re: "IF (OR..." conditional statement

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
Valued Contributor

Re: "IF (OR..." conditional statement

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

MVP
MVP

Re: "IF (OR..." conditional statement

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

jsingh71
Valued Contributor

Re: "IF (OR..." conditional statement

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

MVP
MVP

Re: "IF (OR..."   conditional statement

Today is your lucky day.. !

Community Browser