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

Home

 
4D v19.8
entitySelection.count( )

entitySelection.count( ) 


 

entitySelection.count ( attributePath ) -> Result 
Parameter Type   Description
attributePath  Text in Path of the attribute to be used for calculation
Result  Real in Number of non null attributePath values in the entity selection

The entitySelection.count( ) method returns the number of entities in the entity selection with a non-null value in attributePath.

Note: Only scalar values are taken into account. Object or collection type values are considered as null values.

An error is returned if:

Example  

We want to find out the total number of employees for a company without counting any whose job title has not been specified:

 C_OBJECT($sel)
 C_REAL($count)
 
 $sel:=ds.Employee.query("employer = :1";"Acme, Inc")
 $count:=$sel.count("jobtitle")



See also 

entitySelection.average( )
entitySelection.distinct( )
entitySelection.length
entitySelection.sum( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17

 
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)