1 Reply Latest reply on Feb 5, 2019 9:57 AM by Norbert Maijoor

    Current YTD and Previous YTD

    shanmuga prabhu

      Hi All,

       

      Please let me know how to get current YTD and Previous YTD value for Multiple years

      Now all the years are selected for this selection 2018 YTD and 2017 previous YTD should return.

       

      If user selects only 2017 then Current YTD is 2017 Data value and Previous YTD will be 2016 Data value

       

      For workbook you can use superstore file

       

       

      Thanks

        • 1. Re: Current YTD and Previous YTD
          Norbert Maijoor

          Hi Shanmuga,

           

          Find my approach as reference below and stored in attached workbook version 10.5 located in the original thread,

           

           

          1. YTD:

          if datediff('year',[Date],today())=0

          and [Date]<today() then [Value] END

           

          2. PYTD:

          if datediff('year',[Date],dateadd('year',-1,today()))=0

          and [Date]<dateadd('year',-1,today()) then [Value] END

           

          Hope it helps

           

          Regards,

          Norbert