Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bangelor
Contributor

Count Groups if condition is met

I have the following data (Example):

ObjectStatus
A1
A2
A3
B1
B2
C1
C2
C3
D1

 

I would like to calculate how many Object (types) do not have status "2".  In the given example this would be 1 since only object (type) D does not have the status "2".

I would like to do this using an expression.

Thanks for the help!

1 Solution

Accepted Solutions
Or
MVP

There's probably a good way to do this in one formula, but as a quick hack:

Count(distinct Object) - Count(distinct {<Status = {2} >} Object)

[Edit]

And I believe the cleaner way here would be:

Count( distinct {$<Object= E({1<Status={"2"}>})>} Object)

 

View solution in original post

2 Replies
Or
MVP

There's probably a good way to do this in one formula, but as a quick hack:

Count(distinct Object) - Count(distinct {<Status = {2} >} Object)

[Edit]

And I believe the cleaner way here would be:

Count( distinct {$<Object= E({1<Status={"2"}>})>} Object)

 

Or
MVP

Added a cleaner version in an edit to the original post, if you prefer.