Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I improve the following expression
An improvement could be to change the kind of rate which you calculate from:
(CurrentYear - LastYear) / LastYear
to
CurrentYear / LastYear
/* or reversed an/or multiplied with 100 or with (-1 + result) or (result -1) to change the direction from the rate*/
with them you could reduce the calculation-steps from four to two.
Further possible is to transfer your week-selections check into a variable which then returned either the year- or the weekyear-expression which meant those check would be only done one time globally and not for each possible record.
Another possibility might be to create boolean flag-fields for current/last year within the script (disadvantage: (really) isn't flexible against user-selections anymore) and use then simplyfied expressions like:
sum([Prix de vente TTC] * CurrentYearFlag)
- Marcus