4D v14.3Average |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
Average
Average
Average returns the arithmetic mean (average) of series. If series is an indexed field, the index is used to find the average. You can pass an array (one or two dimensions) in series. In this case, the array must be of the Integer, Longint or Real type. If the command is correctly executed, the OK system variable is set to 1. If it is interrupted (for example if the user clicks on the Stop button of the progress thermometer), the OK variable is set to 0. The following example sets the variable vAverage that is in the B0 Break area of an output form. The line of code is the object method for vAverage. The object method is not executed until the level 0 break: vAverage:=Average([Employees] Salary) The following method is called to print the records in the selection and to activate break processing: ALL RECORDS([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 chapter Printing. This example gets the average of the first 15 grades in the selection: ARRAY REAL($ArrGrades;0) |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v11 SQL Release 3 SEE ALSO
ACCUMULATE ARTICLE USAGE
4D Language Reference ( 4D v14 R2) Inherited from : Average ( 4D v12.4) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||