Description:
An iterative loop to get a cumulative value over records in which one of its fields has same values.
Syntax:
cum(x;Gi,…)
Note:
The function performs an iterative loop over records whose Gi field contains same values to compute expression x and add its previous value to the current one. Each time when the value of Gi field changes, perform a new round of calculation.
Parameter:
x |
An expression |
Gi |
Field name |
Return value:
The result of the given expression’s current value plus its previous one
Example:
|
A |
|
1 |
=demo.query("select * from SCORES ") |
|
2 |
=A1.derive(cum(SCORE+10;CLASS):F1) |
|
3 |
=A1.derive(cum(SCORE+10;CLASS,STUDENTID):F1) |
|