Sum squares

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 3


Sum squares (series) Number

ParameterTypeDescription
seriesFieldData for which to return the sum of squares
Function resultNumberSum of squares of series

Description

Sum squares returns the sum of the squares of series. If series is an indexed field, the index is used to find the sum of the squares.

Example

The following example is an object method for the variable vSquares. The object method assigns the sum of squares for a data series to vSquares. The vSquares variable is printed in the last break of the report:

   vSquares:=Sum squares ([Table1]DataSeries)

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

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

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

Average, Std deviation, Sum, Variance.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next