Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
for KPI Sum(Aggr(If(Sum(MARKS_SCORED)>0, Sum(MARKS_SCORED)), STUDENT_ID))
Is this what you are trying to do ?
for KPI Sum(Aggr(If(Sum(MARKS_SCORED)>0, Sum(MARKS_SCORED)), STUDENT_ID))
So placement of my group by field was wrong .. 😞