4 Replies Latest reply on Mar 30, 2017 9:35 AM by Ben Newell

# How can I count the number of sequential identical values?

I am having difficulty figuring out how to count the number of sequential identical values in a dataset. I would like a chart that increments by 1 every time [result] is FAIL/0 and return to 0 when [result] = PASS/1 occurs. The values PASS/FAIL and 0/1 are arbitrary - they are defined by a calculated field that determines the [result].

For example, my x-axis is TIMESTAMP. As time progresses, I want the chart to rise each time a failure occurs and return to 0 with a pass.

• ###### 1. Re: How can I count the number of sequential identical values?

Hi Brian,

Would you be able to post a sample workbook (twbx file)? Thanks!

-Tracy

• ###### 2. Re: How can I count the number of sequential identical values?

A sample workbook will be great - I think you'll end up with something like:

if [result]="Pass/1" then 0 elseif [result]="Fail/0" then previous_value(0)+1 end

• ###### 3. Re: How can I count the number of sequential identical values?

Brian-

Did you find anything further on this? I have posted something similar that I'm looking to tackle: http://community.tableau.com/thread/119308

Let me know if you have anything please!

Best,

Erik

• ###### 4. Re: How can I count the number of sequential identical values?

Hey Brian... Take a look at this chart.