Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I've to create a variable which calculates YTD and Previous year YTD.
Here is my requirements.
For Prev YTD it has to calculate from Jan to Dec.ie Jan 2015 to Dec 2015. and
Current year YTD calculated from Jan to till current month ie from Jan 2016 to Feb 2016.
Can Anyone help me .
Thanks In Advance.
Thanks,
Anusha
Use set analysis to do that.
Current Year : Sum(Sales)
Past Year : Sum({<MyYear={$(=Max(MyYear)-1), MyMonth}>} Sales)
When you select 2016, the second expression calculate last year. Take care with de Month selected, in this case I include the month in the set in order you have the full year.
Hi,
may be like this,
Current Year:
Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(YearStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)
Previous Year:
Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(YearStart(Max(DateNum))-1))<=$(=Max(DateNum))"}>} Sales)
HTH,
Hirish