Sum

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


Sum (series) Number

ParameterTypeDescription
seriesField or subfieldData for which to return the sum
Function resultNumberSum for series

Description

The Sum command returns the sum (total of all values) for series. If series is an indexed field, the index is used to total the values.

Example

The following example is an object method for a variable that vTotal placed in a form. The object method assigns the sum of all salaries to vTotal:

    vTotal:=Sum([Employees]Salary)

The following method is called to print the records in the selection and to activate break processing:

   ALL RECORDS ([Employees]) 
   ORDER BY ([Employees];[Employees]LastNm;>) 
   BREAK LEVEL (1) 
   ACCUMULATE ([Employees]Salary) 
   OUTPUT FORM ([Employees];"PrintForm") 
   PRINT SELECTION ([Employees])

Note: The parameter to the BREAK LEVEL command should be equal to the number of breaks in your report. For more information about break processing, refer to the printing commands.

See Also

ACCUMULATE, Average, BREAK LEVEL, Max, Min, ORDER BY, PRINT SELECTION, Subtotal.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next