Reply To: Sum operator

#6211
Bill Finzer
Keymaster

Hi Andee,

The sum function expects a single expression to be summed over all cases. Here’s the documentation:

sum(number, filter) Returns the sum of its argument evaluated for every case.

sum(grade_point) computes the sum of the grade points

sum(Mass, Height>60) returns the sum of the masses for heights taller than 60

The strange results you get from sum(V1,V2,V3) are the result of summing the values of V1 over all cases for which V2 look true, totally ignoring V3.

V1+V2+V3 is the best way to get the sum of the values for the three attributes for each case.

Hope this helps,

Bill