2 Replies Latest reply on Jul 17, 2018 1:56 AM by Jade Royers

    QoQ / MoM growth in a line chart

    Jade Royers

      Dear Tableau community,

       

      I'm desperately trying to display either the quarter over quarter growth (eg Q1 2018 vs Q1 2017) or the month over month growth (eg May 2018 vs May 2017) on a line chart.

       

      I recreated my viz thanks to the Superstore data, please see attached. I work with Tableau Desktop 10.5.

       

      I created 3 parameters :

      • One that allows the end user to choose a start date;
      • Another one to chose the end date;
      • And a last one to be able to choose to look at sales in years, quarters, or months.

       

      Then I created a calculated field called "Variable date axis" that allows me to display the date with the correct format based on the selection of "Date Level".

       

      To be able to use the quick table calculation re-starting every year, I added the Year on the details shelf. The issue with that solution is that I have "breaks" in the line in between each year and that there is no growth computed for January/Q1.

       

      Do you know how could I display a continuous line that would either display the quarter over quarter growth or the month over month growth based on user selection ?

       

      Many thanks for your help!!

       

      Jade

        • 1. Re: QoQ / MoM growth in a line chart
          swaroop.gantela

          Jade,

           

          I may not have caught the gist of the month over month,

          but it appeared to me that your calculation was subtracting from the previous period.

           

          The value from the same period from the previous year might look something like this:

          IF [Date Level]="quarter" THEN

          LOOKUP(ZN(SUM([Sales])),-4)

          ELSEIF [Date Level]="month" THEN

          LOOKUP(ZN(SUM([Sales])),-12)

          ELSEIF [Date Level]="year" THEN

          LOOKUP(ZN(SUM([Sales])),-1)

          END

           

          Then the percentage change would look similar:

          (ZN(SUM([Sales])) - [SamePeriodPreviousYear]) / [SamePeriodPreviousYear]

           

          However, this type of calculation will only provide values from year 2 onwards.

           

          Please see the workbook v10.5 attached in the Forum thread.

           

           

          275786diff.png

          1 of 1 people found this helpful
          • 2. Re: QoQ / MoM growth in a line chart
            Jade Royers

            Hi swaroop.gantela,

             

            Thank you SO MUCH for your help!! This is exactly what I needed. You made my day!