Min

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 11.3 (Modified)


Min (series) Number

ParameterTypeDescription
seriesFieldData for which to return the minimum value
Function resultNumberMinimum value in series

Description

Min returns the minimum value in series. If series is an indexed field, the index is used to find the minimum value.

If the series selection is empty, Max returns 1E50.

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.

Examples

1. The following example is an object method for the variable vMin placed in the break 0 portion of the form. The variable is printed at the end of the report. The object method assigns the minimum value of the field to the variable, which is then printed in the last break of the report:

   vMin:=Min([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.

2. The following example finds the lowest sale amount of an employee and displays the result in an alert box:

   ALERT ("Minimum sale = " + String(Min([Employees]Sales)))

See Also

Max.


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