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
Try like,
=Sum({$<Date={">=$(=AddMonths(Min(Date),-12))<=$(=AddMonths(Max(Date),-12))"}>}Amount)
try the code like given below as per your need...
=Sum({$<Year=P({<Year={$(=max(Year)-1)}>}Year),month=P({<Year={$(=max(Year)-1)}>} month>} TotalPrice)
Try like this
sum({<Date = {$(=AddYears(Date,-1))}>} Sale)
Hi Gowtham,
As Avinash R mentioned an expression,
Take it in a variable and u'll get the last year same date. some modification
i.e. vVariable = date(AddYears(max(Date), -1),'MM/DD/YYYY')
or
vVariable = date(AddMonths(max(Date), -12),'MM/DD/YYYY')
use variable any where
try this
sum({<Date = {"$(=addyears(max(Date),-1))"}, Date=>} Sale)
Another option.. setdateyear ‒ QlikView
working for single date but i need for multiple dates
Try like,
=Sum({$<Date={">=$(=AddMonths(Min(Date),-12))<=$(=AddMonths(Max(Date),-12))"}>}Amount)
not working bro
I think you are looking for this?
=Sum({$<Date={">=$(=yearstart(addyears(Max(Date),-1)))<=$(=addyears(Max(Date),-1))"}, Date=>}Amount)