The functions of this theme perform calculations on a series of values.
The Average, Max, Min, Sum, Sum squares, Std deviation, and Variance functions can be applied to fields or subfields. In the case of a field, they are applied to a selection of records. In the case of a subfield, they are applied to a selection of the subrecords of the current record. Note that the
Sum squares, Std deviation, and Variance functions can be used on a field only during printing.
These functions work on numeric data only. Each of these functions returns a numeric value.
Using a field
When Average, Max, Min, or Sum are used on a field outside a printing operation, they may have to load each record in the current selection to calculate the result. If there are many records, this process may take some time. To avoid this, index the field.
When these functions are used in a report, they behave differently than at other times. This is because the report itself must load each record. Use these functions in a form or object method when printing with the PRINT SELECTION command or when printing by choosing Print from the File menu in the User environment.
When you use these functions in a report, the values that are returned are reliable only at break level 0, and only when break processing is turned on. This means that they are useful only at the end of a report, after all the records have been processed.
You would use these functions only in an object method for a non-enterable area that is included in the B0 Break area.
Remember that the field passed as a parameter to the statistical function must be a numeric.
Average, Max, Min, Std deviation, Sum, Sum squares, Variance.