This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
entitySelection.min( )

entitySelection.min( ) 


 

entitySelection.min ( attributePath ) -> Result 
Parameter Type   Description
attributePath  Text in Path of the attribute to be used for calculation
Result  Mixed in Lowest value of attribute

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 (excluding null values).

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). 

entitySelection.min( ) returns undefined if the entity selection is empty or attributePath is not found in the object attribute. 

An error is returned if:

  • attributePath is a related attribute,
  • attributePath designates an attribute that does not exist in the entity selection dataclass.

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.max( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17
Modified: 4D v18 R6

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)