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

Sum if value is greater than the average

Hello,

I would like to sum in chart only values that are greater than the average of this field.

for example:

Data

ID Country Amount
1France10
2France16
3France12
7Greece32
8Greece34
9Greece38
4Spain24
5Spain22
6Spain21

I use this function: sum(aggr(if(sum(Amount)>avg(TOTAL <Country> amount),sum(Amount)),Country,ID))

Chart:

CountryAvg(Amount)What I want to getwhat I get
France12.666667160
Greece34.666667380
Spain22.333333240

Any suggestions?

Thanks

1 Solution

Accepted Solutions
rubenmarin

Hi Amber, it should work... the Amount field in the avg is lowercase, is that a typo in the post? if not that can be the issue.

View solution in original post

3 Replies
rubenmarin

Hi Amber, it should work... the Amount field in the avg is lowercase, is that a typo in the post? if not that can be the issue.

hic
Former Employee
Former Employee

It should work if you fix the typo.

HIC

Image1.png

Anonymous
Not applicable
Author

Thanks!!!