3 Replies Latest reply on Sep 20, 2016 11:08 AM by Joe Oppelt

# How to get Running Sum to Exclude the First Data Point?

Hello,

One of my calculations involve running sums of incremental data points. 2 out of 3 values are incremental data while the third value is calculated using cumulative data.

The formula looks like this

RUNNING_SUM([Incremental A]) / (RUNNING_SUM(([Incremental B ]) + RUNNING_SUM(([Incremental C])))

Incremental B is calculated as Sum([B]) - Lookup(Sum(B), -1) This resulted in a blank value for the first Evaluation Period.

Usually this is fine as I would just hide the first time period. However, the running sum starts at the first Evaluation Period and I would get an value for A and C , B would be null. At the second period, I would get the sum of Period 1 and 2 for A and C while only getting the B value for period 2. Is there anyone to force tableau to ignore the first Evaluation Period and start the running sum from the second?

Thanks,

• ###### 1. Re: How to get Running Sum to Exclude the First Data Point?

Create a calc called [Index] that looks like this:

INDEX()

that's it.

Now (for the sake of testing) put that on the label so that you can see the values of INDEX.  You may need to mess with TABLE(across) TABLE(down) or other settings.  What you want is to understand what it takes to get INDEX=1 for the first value, (or to get a value that you can always identify) and then tell the running sum not to evaluate for that value.

If I had a workbook to mess with, I could show you easier than I can to describe it.  If you can't understand what I was trying to describe above, post a workbook and I'll show you.

• ###### 2. Re: How to get Running Sum to Exclude the First Data Point?

Hi Joel,

I'm new to Tableau, can you elaborate on how to get the Running_Sum function to exclude Index() = 1?

Thanks

• ###### 3. Re: How to get Running Sum to Exclude the First Data Point?

IF INDEX <> 1 then RUNNING_SUM([Incremental A]) / (RUNNING_SUM(([Incremental B ]) + RUNNING_SUM(([Incremental C]))) END

But again, this will require setting up INDEX so that it runs along the months properly.