Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This expression is "nearly" working, expect that it only gives me last Feb and not Jan & Feb?
=SUM({<Year={'$(vPriorYear)'},Month={'$(vMaxMonth)'}>} Sales)
Any idea what I need to change?
Thanks.
Writing Month={'$(vMaxMonth)'} means it will show the last month, you might want to change that ![]()
Cheers,
Lucas
try this
SUM({<Year={'$(vPriorYear)'},Month={'<=$(vMaxMonth)'}>} Sales)
For some reason changing to
SUM({<Year={'$(vPriorYear)'},Month={'<=$(vMaxMonth)'}>} Sales)
Gives me 0, I had tried this before. Maybe its how I am setting up the variable?
vMaxMonth = Month(max([Transaction Date]))
Setting vMaxMonth to Month(max([Transaction Date])) means you will get 1 month, try making another variable v2ndLastMonth = Month(max([Transaction Date])-1) and then adding it into your set analysis. This will give you the last month and the second-last month
It is either (have not had chance to test....)
1) the <= quote are in the wrong place:
SUM({<Year={'$(vPriorYear)'},Month={<='$(vMaxMonth)'}>} Sales)
2) You need to use double quotes to get the expression to evaluate in the brackets
SUM({<Year={"$(vPriorYear)"},Month={"<=$(vMaxMonth)"}>} Sales)