1 Reply Latest reply: Jun 2, 2011 11:41 PM by Johannes Sunden RSS

    Rolling 12 Months to Date vs  Same Period Last Year

    Bill Cabiro

      I'm new to QV.  I need to have the 4 columns, similar to date wizard result but instead of year to date, I need  the following running time periods (dynamic running to date):

       

      Previous 12 Months / Last 12 Months / Change / Change %.

       

      And Previous 52 Weeks / Last 52 Weeks / Change / Change %

       

      I've tried modifying the wizard script for 6 months into 12 but it does not work.

       

       

      Thanks for you help.  Please do not attach a qvw file, my test edition does not allow to open.  Just paste the script text.

       

      Regards, Bill

        • Rolling 12 Months to Date vs  Same Period Last Year
          Johannes Sunden

          What's the difference between Previous 12 Months and Last 12 Months?

          I assume that if we look at today, The Last 12 Months would be July 2010 - June 2011 and the Previous 12 Months would be July 2009 - June 2010? Is that correct?

           

          In that case you could use the Addmonths() function and add a negative 12 (-12) or 24 (-24) as number of months. Try searching for "addmonths" in the forum to find some examples on usage.