sum
The sum function is used (along with the sumtotal function) to maintain and validate the sum of a specified numeric field. This function is called with no parameters in the extended rule of the field for which you need to keep a running sum. Optionally, you can add a string parameter—the first character in the string indicates whether the value of the field is treated as a negative number before it is added to the running sum of the field. If the first character of the string begins with N or n, the value from the field is treated as a negative and added to the sumtotal.
Syntax 1
sum();
Example 1
An example of this function follows:
sum();
//This maintains a running sum for the field on which the extended rule is
//called.
Syntax 2
sum(“nString”);
Example 2
An example of this function follows:
sum(“n”);
//This adds the value of the field as a negative number to the sumtotal to
//maintains a running sum for the field on which the extended rule is called.