count()

Read(702) Label: count,

Here’s how to use count() function.

A. count( x )

Description:

Compute x with each member of the sequence and then count the number of non-null sequence members of the new sequence.

Syntax:

A.count(x)

Equivalent to A.(x).count()

Note:

The function loops through members of sequence A to compute expression x and returns the number of records that make x non-null.

Parameter:

A

A sequence.

x

Generally an expression of a single field name, or a legal expression composed of multiple field names.

Return value:

An integer

Example:

 

A

 

1

=demo.query("select * from EMPLOYEE")

 

2

=A1.count(HIREDATE)

Count the number of records whose HIREDATE is not null

3

=A1.(SALARY+1000).count()

Add 1,000 to each value of SALARY and then count the number of records

Related function:

A.count()

A. count()

Description:

Count the number of non-null members in a sequence.

Syntax:

A.count()

Note:

The function counts the number of the non-null members in the sequence A.

Parameter:

A

A sequence

Return value:

An integer

Example:

 

A

 

1

=[1,2,3,4].count()

4

2

=[1,null,3,4].count()

3

3

=count(1,null,3,4)

3

Related function:

A.sum()

A.avg()

A.min()

A.max()

A.variance()

A.count(x)