1 Reply Latest reply: Apr 7, 2016 7:19 AM by Sunny Talwar RSS

    Growth versus previous year

    Pierre-Marie Tanier

      Dear QV community,

       

      I'm trying to do the below graph representing the growth of the month versus the same month last year.

       

      I have been trying the function above but it is calculating the growth versus previous month.

       

      Any help

       

      I attached my samples database for reference

      Growth example.png

        • Re: Growth versus previous year
          Sunny Talwar

          May be this:

           

          Script:

          Table:

          LOAD Date,

            MonthName(Date) as MonthYear,

              Account,

              Salesman,

              Company,

              Brand,

              Pack,

              Market,

              Box,

              Pack1,

              EUR

          FROM

          [test 2 (2).xlsx]

          (ooxml, embedded labels, table is Sheet1);

           

          LinkTable:

          LOAD Distinct

            MonthYear as LinkMonthYear,

            MonthYear,

            'CY' as Flag

          Resident Table;

           

          Concatenate (LinkTable)

          LOAD Distinct

            MonthYear as LinkMonthYear,

            MonthName(AddYears(MonthYear, -1)) as MonthYear,

            'PY' as Flag

          Resident Table;

           

          Line Chart

           

          Dimension: LinkMonthYear and Company

          Expression: =Sum({<Flag = {'CY'}>}EUR)/Sum({<Flag = {'PY'}>}EUR) - 1

           

          Capture.PNG

           

          UPDATE: I had to exclude Company 3 from the selections because it was skewing the results due to one very high percentage.