Hi all,
I can't understand why this formula (data item) works only if I select Aggregate function = total
if ((?Parametro_mese?) >= 1) then (coalesce([Quantità GEN-1];0)+coalesce([Quantità FEB-1];0)+coalesce([Quantità MAR-1];0)) else (0)+
if ((?Parametro_mese?) >= 2) then (coalesce([Quantità APR-1];0)) else (0)+
if ((?Parametro_mese?) >= 3) then (coalesce([Quantità MAG-1];0)) else (0) +
if ((?Parametro_mese?) >= 4) then (coalesce([Quantità GIU-1];0)) else (0)+
if ((?Parametro_mese?) >= 5) then (coalesce([Quantità LUG-1];0)) else (0)+
if ((?Parametro_mese?) >= 6) then (coalesce([Quantità AGO-1];0)) else (0)+
if ((?Parametro_mese?) >= 7) then (coalesce([Quantità SET-1];0)) else (0)+
if ((?Parametro_mese?) >= 8) then (coalesce([Quantità OTT-1];0)) else (0)+
if ((?Parametro_mese?) >= 9) then (coalesce([Quantità NOV-1];0)) else (0)+
if ((?Parametro_mese?) >= 10) then (coalesce([Quantità DIC-1];0)) else (0)
If I select Aggregate function = Automatic the formula doesn't work in that way: if I choose 4 as parameter (parametro_mese), I obtain an amount that sums Quantità_GEN-1, Quantità_FEB-1, Quantità_MAR-1,Quantità_APR-1,Quantità_MAG-1,Quantità_GIU-1 and Quantità_DIC-1. This result is not correct because the Quantità_DIC-1 doesn't have to be added.
Thanks
Anna
In string comparison values will be lined up as:
1
10
2
3
..
9
You may need to cast the parameter to a numerical value..
Thank you for your reply
where I have to cast the parameter? The parameter is the number of the month.
Anna
cast(?Parametro_mese?;integer)