version 11 (Modified)
The functions of this theme perform calculations on a series of values.
The Average, Max, Min, Sum, Sum squares, Std deviation, and Variance functions are applied to fields. They use a selection of records. Note that the Sum squares, Std deviation, and Variance functions can be used only during printing.
These functions work on numeric data only. Each of these functions returns a numeric value.
Using statistical functions apart from printing
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 limit the processing time, you can index the field.
Note: When the operation is long, a progress thermometer appears. This thermometer has a Stop button that lets the user interrupt the operation. If the user clicks this button, the OK variable is set to 0. If the operation is completed correctly, the OK variable is set to 1.
Using statistical functions in a printed report
When statistical functions are used in a report, they behave in a specific way 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 Design 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.
See Also
Average, Max, Min, Std deviation, Sum, Sum squares, Variance.