# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for
Did you mean:
Partner - Creator II

## Count if with aggr

I am trying to find the number of customers whose profit percentage is more than 50%

Basically, count the number of customers whose (Profit/Total) > 50%

What I tried is as follows but did not work:

SUM(Aggr(IF(Profit/TotalSale>0.5,1,0),Customer))

1 Solution

Accepted Solutions
MVP

Might make sense to throw a distinct in there also

Count(DISTINCT {<customer = {"=Sum(Profit)/Sum(TotalSale) > 0.5"}>} customer)

4 Replies
MVP

Try as follow:

Count({<customer= {"=sum(Profit)/sum(TotalSale>0.5"}>} customer)

Specialist III

Hi,

Small correction in Omar expression:

Count({<customer= {"=sum(Profit)/sum(TotalSale)>0.5"}>} customer)

MVP

what have u corrected?

the missing ) in sum(totalSale) ?

MVP

Might make sense to throw a distinct in there also

Count(DISTINCT {<customer = {"=Sum(Profit)/Sum(TotalSale) > 0.5"}>} customer)

Tags
Community Browser