Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I know we create a month index from the following in script:
Year($(i)) * 12 + num(Month($(i)),'00') as MonthIndex,
This will help compare current year data up to today with Prev Year Data up to the same day in the prev year.
Any help with a solution will be appreciated
Thank you,
Chris
Dear Chris,
Sorry but I couldnt understand your requirement.
Can you please explain with some example.
Regards,
Kaushik Solanki
Hi Kaushik
I need to compare Value in my model for Current year vs Prior year.
I need to compare for example:
sum({<Year = {"$(vMaxYear)"}>}Value) - which is the sum Value for this year up to 7 March 2016
And want to compare this with
sum({<Year = {"$(vPrevYear)"}, MonthIndex = {"<=$(vPrevMonthIndex)"}>}Value)
This Answer give me the Sum of Value for 2015 up to end of March 2015.
I want to limit this answer to Sum of Value up to 07 March 2015.
Any ideas of how we can do this so we compare vMaxYear with vPrevYear up to day level and not just Month Level?
I think we need to Create a day index in script and then use max and prev in variables... but not sure how to script the DayIndex in backend
Additional Variables:
vMaxYear = max(Year)
vPrevYear = vMaxYear-1
vMaxMonthIndex =max(MonthIndex)
vPrevMonthIndex =vMaxMonthIndex-12
Thank you
Chris Neumann
Hi,
You will have to work with dates.
Try this.
Sum({<Date = {">=$(=Addyears(Yearstart(Max(Date)),-1))<=$(=Addyears(Max(Date),-1))"},Year=,Month=>}Sales)
This will give your Previous Year YTD.
Regards,
Kaushik Solanki
Thanks, 100%