2 Replies Latest reply on Sep 12, 2018 2:20 AM by chris monger

    Filter for YTD full months

    Mihail Mitev

      Hi everyone,

       

      Hope you are having a nice day. I have been trying to create a filter that will enable me to compare Sales for YTD. The way I am trying to compare them is a bit strange tho. Don't need the filter to show the latest data necessarily, but rather the data up until and including the latest full month. For example today's date is 12/09/2018. I would like to compare all the months data up until August this year with the corresponding data from last year.

       

      The filter I have currently set up goes filter for the latest data. It is:

       

      IF

      DATEDIFF('year',[Date],[Last Period (YTD)])=0

      THEN 1

      ELSEIF

      DATEDIFF('year',[Date],[Last Period (YTD)])=1

      AND

      DATEPART('month',[Date])<=DATEPART('month',[Last Period (YTD)])

      THEN 1

      ELSE 0

      END

       

      Where [Last period (YTD)] is just MAX([Date])

       

      Thank you so, so much for the help .

       

      Mihail