Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Why do I have to specify the same set expression ( {<Year={2012}>} ) twice? First time for sum() and second for max().
=Max({<Year={2012}>} aggr (sum( {<Year={2012}>} Sale),Company_Name,Product))
Initially I though there would be enough to state it for sum, so that only the rows for 2012 would be passed on to the max().
I have taken the example from:
http://www.analyticsvidhya.com/blog/2014/02/aggr/
The blogger states that the expression is needed twice, but unfortunately not why.
I believe it is only a waste of processing
The Set Expression with the definition only in the sum statement works perfectly!
=Max( aggr (sum( {<Year={2012}>} Sale),Company_Name,Product))
A "set statement" creates a static set of data, should be included only in the part that defines the value
As I stated in my initial post and stated by the original blogger, both are needed to get correct result.
Each aggregation function can leverage a unique set statement whether or not its inclusive of the inner set or not. This is for maximum flexbility
Below for example, the inner set is on AccountID=1 , but the outer set is on AccountID=2
so what happens ?
the outer is what is used on where to render the values, but the inner set is being used for the subtotalling .
pretty flexible.