ranki()

Read(513) Label: interative loop, number records,

Description:

An interative loop for numbering records according to the values of certain fields.

Syntax:

ranki(F;Gi,…)

Note:

The function performs a loop operation to number records from 1 according to the value of Gi field. With the same Gi field value, records having the same F field value will be given the same sequence number; add 1 to the sequence number when F field value changes. When the value of Gi field changes, start a new round of the numbering process.

Parameters:

F

Field name; under same Gi field value, records with same F field value have same sequence number; add 1 to the sequence number if F field value changes

Gi

Field name; in a loop function, number records under same Gi field value by the changes of F field value; renumber a record when Gi field value changes.

Return value:

Integer

Example:

 

A

 

1

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

 

2

=A1.derive(ranki(STUDENTID;CLASS):F1)