cancel
Showing results for
Did you mean:
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_ID SUBJECT MARKS_SCORED ABC0001 English 8 ABC0001 Science -5 ABC0001 History 10 ABC0002 English -5 ABC0002 Science -5 ABC0002 History 6 ABC0003 English -4 ABC0002 Science -5 ABC0002 History 10
Labels (3)

• ### sumif

1 Solution

Accepted Solutions
Employee

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

3 Replies
Employee

Is this what you are trying to do ?

Employee

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

Contributor III
Author

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