3 Replies Latest reply on Dec 8, 2018 1:02 PM by Jennifer VonHagel

    Need help with running sums - (Tableau newbie)

    Amit Dalmia

      Hi everyone,

       

      I am looking to create a chart with the running sum on the Y-axis and Date on the X-axis. Here is the sample data for understanding of the problem -

       

         

      flagactivation_datecreated_date
      029-Nov-1826-Nov-18
      029-Nov-1826-Nov-18
      127-Nov-1826-Nov-18
      027-Nov-1826-Nov-18
      127-Nov-1826-Nov-18
      128-Nov-1826-Nov-18
      128-Nov-1826-Nov-18
      027-Nov-1826-Nov-18
      127-Nov-1826-Nov-18
      028-Nov-1827-Nov-18
      128-Nov-1827-Nov-18
      128-Nov-1827-Nov-18
      028-Nov-1827-Nov-18
      128-Nov-1827-Nov-18
      128-Nov-1827-Nov-18
      128-Nov-1828-Nov-18
      128-Nov-1828-Nov-18
      028-Nov-1828-Nov-18
      029-Nov-1828-Nov-18
      028-Nov-1828-Nov-18
      129-Nov-1828-Nov-18
      029-Nov-1828-Nov-18
      029-Nov-1828-Nov-18
      129-Nov-1828-Nov-18

       

      When one takes the sum of 'flag' values by activation_date, we get the table as  -

       

        

      Row LabelsSum of flag
      27-Nov-183
      28-Nov-188
      29-Nov-182
      Grand Total13

       

       

      BUT (there is always a but )...

       

      I want to create a chart with the corresponding table like below -

         

      activation_datesum of flag
      27-Nov-183
      28-Nov-1811(sum of 3 + 8)
      29-Nov-1813(sum of 11 + 2)

       

      I know how to do this in Excel but how do I do this in Tableau. I am assuming it is quite a basic ask and would really appreciate some help! The Tableau community seems buzzing with helpful replies and hence, I am quite optimistic to get help.

        • 1. Re: Need help with running sums - (Tableau newbie)
          Zheng Kang

          You need add table calculation then choose calculation type and compute using (Table down)

          123.png

          1 of 1 people found this helpful
          • 2. Re: Need help with running sums - (Tableau newbie)
            Amit Dalmia

            Thanks for the help Zheng!

             

            Another small query - Let us say that I want to enable the filter on the X-axis (Date). Something like - last 7 days or last 30 days.

             

            Assuming the raw data has been there for a year or so, the suggested solution takes the value pertaining to the first date passing through the filter.

             

            Example - If I want to enable the filter on date as (after 27th November) and yet want to see the value of 11 against 28th November, how do I do that?

            • 3. Re: Need help with running sums - (Tableau newbie)
              Jennifer VonHagel

              Hello Amit,

               

              You can create a Date Filter that is a Table Calculation. This will have the result of hiding filtered dates from the view, but they are still counted in the calculations.

               

              All the Date Calculation does is lookup the order date.  You can see how it is created here. Its only purpose is to have a list of dates that are a Table Calculation, so that the filter will hide rather than exclude dates you choose not to show.

               

              LOOKUP(MAX([Order Date]),0)

               

              So here I have Quantity and Running Sum of Quantity going down Order Date. Notice that 1/9/2015's Running Sum is 58.

               

              If we filter the Date Filter to hide previous dates, it still shows 58:

               

              I hope this helps.

               

              best,

              Jennifer