Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everybody,
I am trying to get a year over year analysis to work both by year/quarter/month/week selections.
And also working in selected StartDate/EndDate calendar object.
So I can select any time interval by StartDate/EndDate calendar.
The variables for year over year I used below:
vLastYear=addmonths(MaxString(Delivery_Date),-12)
vCurrentYear=if(GetSelectedCount(Year)=0,max(Year),Year)
The value of Delivery_Date column is started from 1/1/2016.
Now I need to get a year over year value into text object:
Current Year Sales:
=sum({<Year={$(vCurrentYear)}>} Delivery_Amount)
Last Year Sales:
=sum({<Delivery_Date={">=$(=yearstart(vLastYear))<=$(=(vLastYear))"}>} Delivery_Amount)
The issue is when I don't select Year, the Last Year Sales is correct, but if I select 2017 in Year selections,
the Last Year Sales is 0.
If the time interval of Last Year Sales is out of Year selection or not?
Can anybody help me to correct the variables or extensions?
Many thanks
Ming
Try this
=Sum({<Delivery_Date={">=$(=yearstart(vLastYear))<=$(=(vLastYear))"}, Year>} Delivery_Amount)
Try this
=Sum({<Delivery_Date={">=$(=yearstart(vLastYear))<=$(=(vLastYear))"}, Year>} Delivery_Amount)
It's you! thank Sunny!