cs.total()

Read(785) Label: cursor, aggregation,

Description:

Perform aggregation over records in a cursor.

Syntax:

cs.total(y,…)

Note:

The function performs aggregation over recods in a cursor. Parameter y is the aggregate function over cs. The function returns a single value when there is only one aggregate function; or returns multiple values in order for multiple aggregate functions.

Parameter:

cs

Cursor

y

Aggregate function, only support sum/count/max/min/top/avg/iterate; Parameter Gi should not be present when the function works with iterate(x,a;Gi,…) function

Return value:

Numeric value or a sequence of numeric values

Example:

 

A

 

1

=demo.cursor("select * from SCORES where CLASS = 'Class one'")

 

2

=A1.total(sum(SCORE))

Return a single value.

3

=A1.reset()

Move the cursor back to the beginning.

4

=A1.total(sum(SCORE),count(SUBJECT),max(SCORE))

Return a sequence of values according to the order of the aggregate functions.