Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Mave_afs
Contributor
Contributor

Aggregate and Count with Condition

Hello All,

 

I need to create a KPI which will show the count of students (Column Student) who have scored combinedly > 40 Score

Ideal answer for below example will be 2 as Student 1 scored 45 and Student 3 scored 53 making count as 2

Student Subject Score
1 subject1 10
1 subject2 20
1 subject3 15
2 subject1 12
2 subject2 21
2 subject3 0
3 subject1 22
3 subject2 12
3 subject3 29
Labels (5)
1 Reply
E_Røse
Creator II
Creator II

Try this:

 

sum(if(aggr(Sum(Score),Student)>40,1))

 

Elin_Rse_0-1677505143473.png 

Note that the aggr- function returns exactly one value per student, so you do not need to worry about duplicates when you take the sum.

Please like and mark my answer as a solution, if it resolved your issue.