Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
sum({$<Year = {$(=max(Year))}, Month = {"<=$(=max({<Year={$(=max(Year))}>} Month))>$(=max({<Year={$(=max(Year))}>} Month)-1)"}>} LineSalesAmount)
Can any one explain this?
The dollar sign expansions will be replaced by the evaluated expressions, e.g. $(=max(Year)) will be replaced by the max Year value possible in your default set.
Assume you have data for 2014 and 2015 and no selection by the user. Max(Year) will be 2015.
max({<Year={$(=max(Year))}>} Month) will return the max possible Month for the max possible Year, so if you have data for each month in 2014, but only up to November in 2015, you will get 11 (numerical value for November).
So your set expression in this scenario will boil down to:
sum({$<Year = {2015}, Month = {"<=11>10"}>} LineSalesAmount)
The search in the Month is intended to return a value list of {11}, since there is only one value larger than 10 and smaller equal 11 (assuming integer values for Month).
Not sure if this is what you really want though.
Hope this helps
The dollar sign expansions will be replaced by the evaluated expressions, e.g. $(=max(Year)) will be replaced by the max Year value possible in your default set.
Assume you have data for 2014 and 2015 and no selection by the user. Max(Year) will be 2015.
max({<Year={$(=max(Year))}>} Month) will return the max possible Month for the max possible Year, so if you have data for each month in 2014, but only up to November in 2015, you will get 11 (numerical value for November).
So your set expression in this scenario will boil down to:
sum({$<Year = {2015}, Month = {"<=11>10"}>} LineSalesAmount)
The search in the Month is intended to return a value list of {11}, since there is only one value larger than 10 and smaller equal 11 (assuming integer values for Month).
Not sure if this is what you really want though.
Hope this helps
Thank you. it helps me a lot.