7 Replies Latest reply: Aug 30, 2016 7:01 AM by shweta gupta RSS

    Previous to Previous year till date

    shweta gupta

      Hi All,


      I am trying to calculate current year over previous year over previous to previous year.

      Where Date1 is my date field, vYear, vMonth, Vquarter are from fiscal calendar.,


      For current year : sum({< vYear = {"$(=max(vYear))"}>} invoice_qty)



      For Last  year till date :

      Sum({<vYear=, vMonth=, VQuarter=,

      Date1={">=$(=Date(YearStart(Max(Date1),-1,4)))<=$(=Date(addyears(Max(Date1),-1))) "}>}invoice_qty)



      For last to last year till date(LLYTD):

      Sum({<vYear=, vMonth=, VQuarter=,

      Date1={">=$(=Date(YearStart(Max(Date1),-2,4)))<=$(=Date(addyears(Max(Date1),-2))) "}>}invoice_qty)


      In above expression I am not not getting values corresponding to LLYTD either it gives me the whole sum of three years or shows Zero.


      Can someone please help!!! what am I missing in the expression