Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
livio218526
Creator
Creator

Nested IF with AND operator in Qlik Sense

Hi everyone,

i have a problem when i try to create a new calculated field by using a Nested IF.

For example I have a Field Age and I want create a new Field (Color) with 'A' if Age > 10 and < 20, 'B' if Age >=20 and < 40 and so on...

I try to create this function but Qlik show me this error: missing right parenthesis:


if(Age > 10 and Age < 20,A,

7 if(Age >= 20 and Age < 40,B,))

Thanks,

Livio

36 Replies
prma7799
Master III
Master III

Your expression seems to be ok but without sample file how can I explain to or please  share excel file atleast.

livio218526
Creator
Creator
Author

Capture.JPG

prma7799
Master III
Master III

Please share data don't attach screen shot..

livio218526
Creator
Creator
Author

I can't share, qlik community send me that i'm not authorized for to do this operation.

Anonymous
Not applicable

This worked!! thanks

chaudharybilal
Partner - Contributor III
Partner - Contributor III

Hi

We are facing this same issue, did you get the solution to this ? I don't understand the difference in your script & the one in "Correct Answer".

chaudharybilal
Partner - Contributor III
Partner - Contributor III

We've found a solution: So using the same example If([City Code]> 10 and [City Code] <20, 'A', If([City Code] >= 20 and [City Code] < 40, 'B', 'C'))

We changed it to If([City Code]< 10,'C', if([City Code] <20, 'A', If([City Code]< 40, 'B', 'C')))

This will give you the same result.