cs.()

Read(260) Label: cursor, expression,

Description:

Evaluate the expression with each member in the cursor.

Syntax:

cs.(x)

cs.()     Retrun cs itself

Note:

The function evaluates the expression using each member of the cursor and returns results as a cursor. Use ~ to to reference the current member during the calculation.

Parameters:

cs

Cursor

x

An expression that is generally a single field name; or a legal expression composed of multiple field names. Both can use ~ to reference the current record.

Return value:

A cursor consisting of values of expression x calculated from every member

Example:

 

A

 

1

=connect("demo").cursor("select * from EMPLOYEE where EID<10")

 

2

=A1.(age(BIRTHDAY))

 

3

=A2.fetch()

4

=connect("demo").cursor("select * from SCORES where SCORE<60")

 

5

=A4.(SCORE)

 

6

=A5.(~*~)

Use ~ to reference the current sequence member

7

=A6.fetch()

8

=demo.cursor("select * from DEPARTMENT")

 

9

=A8.()

Return A8

10

=A9.fetch()

 

 

cuboid()

Here’s how to use cuboid() function.

T.cuboid(C,Fi,…;y:Gi,…)

Description:

Store the result set of grouping an entity table as a pre-summarized data cube.

Syntax:

T.cuboid(C,Fi,…;y:Gi,…)

Note:

The function stores the result set of grouping entity table T as a pre-summarized data cube C, where Fi field is the grouping field and Gi field is the result of calculating aggregate function y.

Parameters:

T

Entity table

C

Pre-summarized data cube name; delete the pre-summarized cube with the specified name when only this parameter is present

Fi

Grouping field

y

Aggregate function, support only sum/count/max/min/top/iterate; when working with iterate(x,a;Gi,…) function, parameter Gi isn’t supported

Gi

Field name in result set

Return value:

A composite table object

Example:

 

A

 

1

=file("D://orders.ctx").create()

Open composite table file orders.ctx:

 

2

=A1.cuboid(test,OCount;count(EID):COUNT)

Group A1’s composite table by Ocount, count the number of EID in each group, and store the resul set in the pre-summarized data cube test

 

3

=A1.cuboid(test1,OCount;count(EID):COUNT,min(OAmount):MIN)

Group A1’s composite table by Ocount, count the number of EID and find the minimum value of Oamount in each group, and store the resul set in the pre-summarized data cube test1

 

4

=A1.cuboid()

Delete all pre-summarized cubes

 

5

=A1.cuboid(test)

Delete data cube test