YOY Growth Rate formula across muliple clients/months

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SJ85750
    New Member
    • Apr 2014
    • 6

    YOY Growth Rate formula across muliple clients/months

    I have a table with historical actual items history by client, by month. I have a 2nd table for YOY growth rate by client, by month. I'm looking for help to use these 2 tables to create a forecast for future periods (by month) that would multiple the YOY growth rate (from table 2) by the same prior year's month actuals (frome table 1).

    Today, this is done in excel with the following formula:
    Client 1: May 2014 FCST = ROUND(AR9*1.05, 0), where AR9 is May 2013.

    Code:
    Table 1 Sample:
    Client	MonthValue	YearValue	SumOfItems
    Client 1    1             2014            12
    Client 2    2             2014            10
    Client 1    3             2014            14
    Client 2    10            2013            1
    Client 1    11            2013            14
    Client 2    12            2013            12
    Code:
    Table 2 Sample:
    Client      ForecastMonth      YOY Growth Input
    Client 1      5                  0.00%
    Client 2      5                  10.00%
    Client 1      6                  5.00%
    Client 2      6                  2.00%
    Client 1      7                  10.00%
    Client 2      7                  10.00%
    Last edited by zmbd; Apr 12 '14, 07:11 PM. Reason: [z{added code tags to preserve table formatting}{removed tabs/replaced with spaces}]
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    I'm not sure what I YOY Growth Rate is, but I think that I can follow your formula. I think that the easiest method would use a DLookup() function. Something like this
    Code:
    Round([SumOfItems] * DLookup("YOY Growth Input", "Table 2", "Client = " & Client & " And ForecaseMonth = " & MonthValue) + .000001, 0)
    This would get you the prediction for the next year. But I believe from your question that you want the prediction for the current year based on last year's value. So, here I do that in a query.
    Code:
    SELECT Client
    , MonthValue
    , YearValue
    , SumOfItems
    , Round(
        DLookup("SumOfItems", "Table 1"
            , "Client = " & Client 
            & " AND MonthValue = " & MonthValue 
            & " AND YearValue = " & YearValue - 1) 
        * DLookup("YOY Growth Input", "Table 2"
            , "Client = " & Client 
            & " And ForecaseMonth = " & MonthValue)
         + .000001, 0) As Prediction
    FROM [Table 1]
    The trick will be that some of your data won't have a record for the previous year so somewhere you would need to allow for that so that you don't get an error. Without a test database to work on, I'm not sure at which step it would be best to do this, but you would just use the Nz() function to test for a returned null value and assign it a number.

    Comment

    • SJ85750
      New Member
      • Apr 2014
      • 6

      #3
      YOY is just short for Year over Year. So, if May 2012 is 250 items and May 2013 is 260 items, then the year over year growth rate (YOY Growth Rate0 is 4%). So, in this example, we'd want May of 2014 to be (4% * 260). Now, I'm doing all of my work in a select query. How do I write this code as part of my query?

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        So are you predicting or just calculating what the growth was?

        Comment

        • SJ85750
          New Member
          • Apr 2014
          • 6

          #5
          The growth rate is an input.

          Comment

          • Seth Schrock
            Recognized Expert Specialist
            • Dec 2010
            • 2965

            #6
            So you input the growth rate and then predict next years amount based on this year?

            Comment

            • SJ85750
              New Member
              • Apr 2014
              • 6

              #7
              Yes.

              Client 1:
              May 2014 = May 2013 * (YOY Growth Rate)
              Jun 2014 = Jun 2013 * (YOY Growth Rate)
              Jul 2014 = Jul 2013 * (YOY Growth Rate)

              Client 2:
              May 2014 = May 2013 * (YOY Growth Rate)
              Jun 2014 = Jun 2013 * (YOY Growth Rate)
              Jul 2014 = Jul 2013 * (YOY Growth Rate)

              Comment

              • SJ85750
                New Member
                • Apr 2014
                • 6

                #8
                Table 1 Variables:
                Client Name
                Forecast Month
                Forecast Year
                YOY Growth Rate

                Table 2 Variables (this table contains all of the historical actuals by month by client):
                Client Name
                Actuals Month
                Actuals Year
                Items

                Does that make sense?

                Comment

                • SJ85750
                  New Member
                  • Apr 2014
                  • 6

                  #9
                  So, I just want the output to be all "future months" of 2014 by Client by month.

                  Comment

                  • zmbd
                    Recognized Expert Moderator Expert
                    • Mar 2012
                    • 5501

                    #10
                    taking a look at your example data... how are you handling months that are in table 2 and NOT in table 1.

                    You can group by client, then month, and use a join on the client+month to return the factor; however, that will only work if you have a corresponding month. You could still use a loopup (yuck) to find the closest month to the target month.

                    Comment

                    Working...