Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pal25
Contributor III
Contributor III

If & and condition isnt working in the calculated field

Hi all,

I am finding error in this below formula. It says "Missing right parenthesis"

IF ([Country] = 'India' AND  Age < 5,'Yes',IF ([Country] <>'India' AND Age < 10,'Yes','No'))

Can someone help to identify the error. I am new to this tool and willing to learn

 

 

Labels (5)
13 Replies
micheledenardi
Specialist II
Specialist II

This part of formula is correct, the error must be somewhere else

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
pal25
Contributor III
Contributor III
Author

What should check ?

When i remove "AND" function (Age<5) , the formula works. But AND is required. 

Unable to figure out why the error coming

micheledenardi
Specialist II
Specialist II

Please share the qlik screenshot where you have this problem

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
pal25
Contributor III
Contributor III
Author

pal25_0-1654698479250.png

Formula with updated variable names

micheledenardi
Specialist II
Specialist II

Seems the AND is not recognized as logical operator.

Which is the object you're writing this expression?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
pal25
Contributor III
Contributor III
Author

Yes looks like AND is not being recognized. Any workaround to that ?

Sorry, dint get your second question on "object". 

qlikeers
Creator
Creator

Maybe try something like this:

=If(Country = 'India',
if(Age < 5,'YES',

(If(not match([Country],'India'),
if(Age < 10,'YES','NO')))))

pal25
Contributor III
Contributor III
Author

Thanks, unfortunately same issue with this one formula as well. 

I am new to qliksense and unable to figure the root cause 😞

 

 

vinieme12
Champion III
Champion III

Where exactly are you trying to add this expression?

Which object is this? expressions need to be added in the expression editor

can you post a full screenshot?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.