4D v17.4

entitySelection.min( )

Home

 
4D v17.4
entitySelection.min( )

entitySelection.min( )  


 

The entitySelection.min( ) method returns the lowest (or minimum) value among all the values of attributePath in the entity selection. It actually returns the first entity of the entity selection as it would be sorted in ascending order using the entitySelection.orderBy( ) method.

If you pass in attributePath a path to an object attribute containing different types of values, the entitySelection.min( ) method will return the minimum value within the first scalar value type in the type list order (see collection.sort( ) description). In this case, if attributePath does not exist in the object, entitySelection.min( ) returns null.

If the entity selection is empty, entitySelection.min( ) returns null.

An error is returned if:

Example  

In this example, we want to find the lowest salary among all the female employees:

 C_OBJECT($sel)
 C_REAL($minSalary)
 $sel:=ds.Employee.query("gender = :1";"female")
 $minSalary:=$sel.min("salary")



See also 

entitySelection.max( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v17)
4D Language Reference ( 4D v17.1)
4D Language Reference ( 4D v17.2)
4D Language Reference ( 4D v17.3)
4D Language Reference ( 4D v17.4)