Hi all,
Hope someone can help me with the following.
I am receiving the error message 'Cannot mix aggregate and non aggregate comparisons or results in IF expressions'.
What am I doing wrong when I use the following formula?
IF YEAR([Booking date]) = YEAR(TODAY())
THEN [Margin (%)]
END
Margin (%) is calculated as follows:
SUM([Margin (€)]) / SUM([Sale amount (€)])
Hi @John Wiegersma
Because Margin% aggregated your condition must be aggregated as well.
Try this and see if it works:
IF ATTR(YEAR([Booking date])) = ATTR(YEAR(TODAY()))
THEN [Margin (%)]
END
That aggregates the condition and the whole thing should work now.
----------------------------------------------------------------------------------------------------------------
Please upvote my helpful replies & choose Select as Best Answer if it really is the best :)