Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I Have a calendar object in that if i select any dates it should give previous year same dates
for multiple dates?? then you need to create a new field in the script AddYears(Date,-1) as Last year date
so that if you select multiple dates then it will give all the dates in the front end
I would just ask you to add all the other calendar field in your set analysis so that you ignore any other selection. For instance using Tamil's expression as an example:
=Sum({$<Date={">=$(=AddMonths(Min(Date),-12))<=$(=AddMonths(Max(Date),-12))"}, Year, Month, MonthYear, Quarter, QuarterYear, Week, WeekYear>}Amount)
Also are you trying to view this year range and next year's range on the date field as a dimension? Something like this?
Date, ThisYear, LastYear
01/01/0216 10, 20
If this is what the goal is, then none of the above expressions are going to work. In that case you would need to look into the Above()/Below() functions.