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

# Need help with running sums - (Tableau newbie)

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 -

 flag activation_date created_date 0 29-Nov-18 26-Nov-18 0 29-Nov-18 26-Nov-18 1 27-Nov-18 26-Nov-18 0 27-Nov-18 26-Nov-18 1 27-Nov-18 26-Nov-18 1 28-Nov-18 26-Nov-18 1 28-Nov-18 26-Nov-18 0 27-Nov-18 26-Nov-18 1 27-Nov-18 26-Nov-18 0 28-Nov-18 27-Nov-18 1 28-Nov-18 27-Nov-18 1 28-Nov-18 27-Nov-18 0 28-Nov-18 27-Nov-18 1 28-Nov-18 27-Nov-18 1 28-Nov-18 27-Nov-18 1 28-Nov-18 28-Nov-18 1 28-Nov-18 28-Nov-18 0 28-Nov-18 28-Nov-18 0 29-Nov-18 28-Nov-18 0 28-Nov-18 28-Nov-18 1 29-Nov-18 28-Nov-18 0 29-Nov-18 28-Nov-18 0 29-Nov-18 28-Nov-18 1 29-Nov-18 28-Nov-18

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

 Row Labels Sum of flag 27-Nov-18 3 28-Nov-18 8 29-Nov-18 2 Grand Total 13

BUT (there is always a but )...

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

 activation_date sum of flag 27-Nov-18 3 28-Nov-18 11 (sum of 3 + 8) 29-Nov-18 13 (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)

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

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

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)

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