Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to compute the number of elements above group's mean value?

How is it possible to compute the number of elements (observations) above each group's mean value. The table or chart should show for each category/group the number of observations which are above of mean of the categrory (Attention: Not the overall mean of all categories). There are more than one category in the dataset I am working on.

I tried to use the following code to achieve the desired result:

=aggr(Count({<pb={">= $(=avg(pb))"}>}[key.ID]), type)

or

=Count({<pb={">=$(=avg({1} total pb))"}>} [key.ID])

Unfortunately, both codes compute as compared with the overall mean.

Any help would be highly appreciated. Many thanks in advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe something like

=Sum( Aggr( If( pb >= Avg(TOTAL<type> pb),1,0), type, [key.ID]))

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe something like

=Sum( Aggr( If( pb >= Avg(TOTAL<type> pb),1,0), type, [key.ID]))

Anonymous
Not applicable
Author

it worked fantastic! Many thanks Stefan!