Hi
I have an expression that rest the value of one year to another year:
if(([ANYO_SELECCIONADO] is null) or ([ANYO_SELECCIONADO]=0))
THEN ([ANYO_ANTERIOR])
else if (([ANYO_ANTERIOR] is null) or ([ANYO_ANTERIOR]=0))
then ([ANYO_SELECCIONADO])
else ([ANYO_SELECCIONADO]-[ANYO_ANTERIOR]) / abs([ANYO_SELECCIONADO])
The problem is that when one of the years has no value or 0, but the other year has a valid value, the expression return me the value /0.
I want to control this value.
Thhx
Might be easier with a case statement:
case
when [ANYO_SELECCIONADO] is missing then [ANYO_ANTERIOR]
when [ANYO_SELECCIONADO] = 0 then [ANYO_ANTERIOR]
when [ANYO_ANTERIOR] is missing then [ANYO_SELECCIONADO]
when [ANYO_ANTERIOR] = 0 then [ANYO_SELECCIONADO]
Else ([ANYO_SELECCIONADO]-[ANYO_ANTERIOR]) / abs([ANYO_SELECCIONADO])
END
Great, now works properly, thx for the support