Button badge count based on multiple criteria being met

We use Coda in our office to manage our software releases and QA testing. Part of testing is having multiple people run through the features functionality and mark it as passed testing.

I’d like to add a badge to the button that indicates how many testers have clicked the button for that specific phase.

I’ve setup buttons that add the results of a tester to a table. It logs the testers name, feature they tested, and phase that passed testing.

I’m having trouble creating a formula that does a unique count based on the feature tested and phase that passed testing. I’m not necessarily worried about having duplicate counts if a testers marks the same feature passed twice.

Here’s an example version of the document that my team uses:

Any help would be appreciated! I’ve tried many different formulas but can’t get anything to do a proper count for the given columns.

What about [Testing log].Filter([Feature name]=thisRow.[Feature Name]).CountUnique()

Unfortunately that doesn’t do a unique count based on the feature AND the stage that’s passed testing. The badge count should be unique to the stage.

For example; if 3 people passed MUT testing it would display 3, 2 passed staging testing it would display 2, and if no one passed testing on prod it would display 0.

Oh I see. So what you want is a filter with multiple conditions. Use AND then:

[Testing log].Filter([Feature name]=thisRow.[Feature Name] AND [Stage passed]="MUT testing").CountUnique()
[Testing log].Filter([Feature name]=thisRow.[Feature Name] AND [Stage passed]="Staging testing").CountUnique()

By the way, CountUnique takes one argument only (a list of values), so you can either use [Table].CountUnique or CountUnique([Table]), but never [Table].CountUnique([expression]).

In addition, if the object you’re counting is a table, CountUnique and Count give the same result, because every row is unique (even if they store the same info).

For CountUnique to work as intended you have to specify what info is supposed to be unique. In your case I assume it’s the Tester (even though you said you weren’t “necessarily worried” about duplicates).

So the formula that filters out duplicates would be:

[Testing log].Filter([Feature name]=thisRow.[Feature Name] AND [Stage passed]="MUT testing").Tester.CountUnique()
1 Like

That makes a lot of sense!

Looking at that formula, I was pretty close, but hadn’t tried the AND function as part of the filter which is what was the main issue.

Thanks so much for the help :grin:

1 Like