4D v17.4

entitySelection.max( )

Home

 
4D v17.4
entitySelection.max( )

entitySelection.max( )  


 

The entitySelection.max( ) method returns the highest (or maximum) value among all the values of attributePath in the entity selection. It actually returns the value of the last 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.max( ) method will return the maximum value within the first scalar type in the default 4D type list order (see collection.sort( ) description). In this case, if attributePath does not exist in the object, entitySelection.max( ) returns null.

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

An error is returned if:

Example  

We want to find the highest salary among all the female employees:

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



See also 

entitySelection.min( )

 
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)