Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
To return sale of highest sold product for previous year I found this expression:
=Max({<Year={$(=Max(Year)-1)}>} aggr (sum( {<Year={$(=Max(Year)-1)}>} Sale),Company_Name,Product))
Why does does Max have to have {<Year={$(=Max(Year)-1)}>} after it, and not just Max(aggr(sum and then the rest?
thanks
Hi,
The above expression is used to get max sales last year.
Hi Amardip,
Thank you.
I am just wondering why the function isn't:
Max(aggr (sum( {<Year={$(=Max(Year)-1)}>} Sale),Company_Name,Product))
instead of
=Max({<Year={$(=Max(Year)-1)}>} aggr (sum( {<Year={$(=Max(Year)-1)}>} Sale),Company_Name,Product))
Do they both mean the same thing? Why is Max(year) used twice?
Have you tried using both the expressions? Do they give you the same results, if they do then in your case it won't matter, but there are times (hard to give an example) where it does make sense to use a set expression in the outermost function also. Ultimately it all depends on the requirement.
Best,
Sunny
As per your statement "sale of highest sold product for previous year" you can do something like attached here