2 Replies Latest reply on May 13, 2015 9:48 AM by Rody Zakovich

    value of this month but in the last year

    Michal Wrobel

      Hi

      I have parameter with month and year.

       

      After selecting Year and month chart shows last 12 months from parameter

       

      I need to show in may Walue in May 2015 and May 2014, in kwiecien 2015 and 2014 etc

       

      ScreenHunter_36 May. 13 18.02.gif

       

      How to do it.

       

      Regards MichaƂ

        • 1. Re: value of this month but in the last year
          Joe Oppelt

          Here is a calc field I use to go back 24 months:

           

          If DATEPART('month',today() )= 12 then

          date("1/1/" + str(DATEPART('year',today() - )-1 ))

          else

          date(str(DATEPART('month',today() )+1)+"/1/" + str(DATEPART('year',today() )-2 ))

           

          In essence it does this:

           

          If December 2015, start January 2014 to get 24 months.

           

          else

           

          If May 2015, start on June 2013 to get 24 months.

           

           

          Use that as a filter, getting all records >= start of 24 months.

          • 2. Re: value of this month but in the last year
            Rody Zakovich

            DATEPART('month', [Data]) = [Month Parameter]

            AND

                 (

                      DATEPART('year', [Data]) = [Year Parameter]

                      OR

                      DATEPART('year', [Data]) = [Year Parameter] - 1

                 )

             

            Throw this on the filter shelf and set to True.