iterate ()

Read(769)

Description:

An iterative loop for calculating an expression.

Syntax:

iterate(x,a;Gi,…)

Note:

The function performs an interative loop to compute expression x – which contains a ~~, and returns the result. Each time when the value of field Gi changes, the value of ~~ becomes a. The parameter Gi can be omitted. When parameter a isn’t supplied, its value is null.

Parameter:

x

An expression containing ~~

a

Initial value

Gi

Field name

Return value:

Value of the given expression

Example:

 

A

 

1

=demo.query("select top 7 * from SCORES ")

 

2

=A1.groups(CLASS:Class,STUDENTID:StudentID;iterate(~~*2): Score1)

3

=A1.groups(CLASS:Class,STUDENTID:StudentID;iterate(~~*2,10): Score1)

4

=A1.derive(iterate(~~*2,10;STUDENTID):F1)

Related function:

A.iterate()