Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
klrameet
Contributor III
Contributor III

Sum of the Marks by Total Marks scored by student is greater than 0

 i am trying to take the sum of all the marks, if the total marks for a student are positive (>0). I am trying to work with below expression but may be i am missing something fundamentally. 

 

Sum(if(Aggr(Sum([MARKS_SCORED]),[STUDENT_ID])>0,[MARKS_SCORED]))

I dont want to count any marks for a student who's total is -ve (<0) whereas if the total for a student is positive (>0), i want to  take his all marks and sum them up (it should also consider any -ve score by that student. 

So total i am expecting from the below example is (i.e. ABC0001:13+ABC0003:1) = 14 

STUDENT_IDSUBJECTMARKS_SCORED
ABC0001English8
ABC0001Science-5
ABC0001History10
ABC0002English-5
ABC0002Science-5
ABC0002History6
ABC0003English-4
ABC0002Science-5
ABC0002History10
Labels (3)
1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

for KPI Sum(Aggr(If(Sum(MARKS_SCORED)>0, Sum(MARKS_SCORED)), STUDENT_ID))

View solution in original post

3 Replies
Lisa_P
Employee
Employee

Is this what you are trying to do ?

Lisa_P_0-1601010766649.png

 

Lisa_P
Employee
Employee

for KPI Sum(Aggr(If(Sum(MARKS_SCORED)>0, Sum(MARKS_SCORED)), STUDENT_ID))

klrameet
Contributor III
Contributor III
Author

So placement of my group by field was wrong .. 😞