Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
a question about the synthax of one expression.
I usually write:
sum (if (Year=max (total year) and field1<>0, field1*quantità1, field2*quantità2))
But now i have to calculate this expression not in Max ( total year) but in the year before the Max (total year) es.(year-1).
I thought SetAnalisys was the correct way, but may be i'm wrong, because i can't reproduce the condition of IF.
Anyone can help me please?
Thanks
Hi,
I think this expression should work:
sum (if (Year=(max (total year)-1) and field1<>0, field1*quantità1, field2*quantità2))
unfortunately it doesn't work!
i suppose SetAnalisys is the right way, but i'm not able to combine
{$<Year = {$(#=Only(Year)-1)}>}
with the condition if...
Any others idea?
thks
Try
{$<Year = {$(#=Only(Year)-1), field = {'<>0'} }>}for the set analysis including that the field1 value is equal to 0ok, but how the expression change from field1 to fiel2 if my condition doesn't occur??
i need that the expression functions in this way:
sum (if (Year=(max (total year)-1) and field1<>0, field1*quantità1, field2*quantità2))
THKS
In that case, you need to use if conditionals anyway, kind of
=If(Year = Max(TOTAL Year) -1 and field1 <> 0, Sum({$<Year = {$(#=Only(Year)-1)}, field = {'<>0'} >} field1 * quantità1), Sum(field2 * quantità2))