Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count If Sum Analysis

I've tried several different types of set Analysis with no luck. The information is sensitive so I replaced the names of the fields with Field 1 and Field 2.


We have a straight table broken out by ID that has a calculation Sum(Field1)/Sum(Field2) Formatted as a %. To show what each ID is current producing. Easy enough


I've been asked to create a KPI that counts How many ID's have Sum(Field1)/Sum(Field2)  <= .5

I've searched and searched and tried to apply my formulas to what I have found in the community with no luck. It seems easy enough, but any calculation I try does not work.

What I have tried so far:

Sum(Aggr(if(count(Sum(Field1)

/

Sum(Field2)) <=.5), Distinct ID))

Produces a 0 result

____

=COUNT({<Sum(Field 1)/Sum(Field 2) = {"=count((Sum(Field 1)/Sum(Field 2)))<=.5"} >} DISTINCT ID)

Calculation has error

1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum(Aggr(If(Sum(Field1)/Sum(Field2) <=.5, 1, 0), ID))

Or this

Count(DISTINCT {<ID = {"=Sum(Field1)/Sum(Field2) <=.5"}>} ID)

View solution in original post

2 Replies
sunny_talwar

Try this

Sum(Aggr(If(Sum(Field1)/Sum(Field2) <=.5, 1, 0), ID))

Or this

Count(DISTINCT {<ID = {"=Sum(Field1)/Sum(Field2) <=.5"}>} ID)

Anonymous
Not applicable
Author

Thank You! It appears to work perfectly.