Skip to main content
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables as part of an IF expression

Hi everyone,

I have the following IF statement that I would like to use. I have a table with an expression =$(vPatientAge)  which works fine. From this I wanted to set up some age groups, so I wrote this:


(AGE(IncDate,$(vPatientAge))<0, 'INVALID',
IF(AGE(IncDate,$(vPatientAge))<18, '0-17',
IF(AGE(IncDate,$(vPatientAge))<65, '18-64',
IF(AGE(IncDate,$(vPatientAge))<100, '65-99', 
IF(AGE(IncDate,$(vPatientAge))<120, '100-120', 'OVER 120')))))   


The IF statement only returns a value of 'OVER 120' what ever the value returned by the variable. Am I doing something wrong in the expression that anyone can see?

Many thanks 



1 Reply

Please post an example document:

talk is cheap, supply exceeds demand