Calculated column as range with IIF function

Stimulsoft Reports.WEB discussion
Post Reply
victorinable
Posts: 152
Joined: Mon Aug 03, 2015 9:28 am

Calculated column as range with IIF function

Post by victorinable »

Hi,

I'm trying to create a calculated column which will indicate the age range. This is done to create a Cross-Data Table, to evaluate the age of a population based on it's sex. I tried to do this:

IIF(Datos_Personales.Edad_Años < 19 ,"<19",
IIF(Datos_Personales.Edad_Años >= 19 & Datos_Personales.Edad_Años <= 21,"19-21",
IIF(Datos_Personales.Edad_Años >=22 & Datos_Personales.Edad_Años <= 24 ,"22-24",">24")
)
)

But all the registers are being marked as "19-21". Can you please explain me if I'm doing something wrong or if this is even possible to do? Other possibility was to create this condition on the Rows of the Tab, but it's still failing to do what I want to.

Thanks in advance.
victorinable
Posts: 152
Joined: Mon Aug 03, 2015 9:28 am

Re: Calculated column as range with IIF function

Post by victorinable »

Hi,

I found what was wrong... Operator "&" should be changed by literal "And".

Now it's working fine, I just missuderstood logical operators.

Thanks.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Calculated column as range with IIF function

Post by Andrew »

Hello,

Thank you for sharing your way of solving the problem.
Post Reply