A running total is a field that accumulates values by adding the current value with a previous total:
| Account | Date
| Amount
|
| 1111 | 1 Jan
| 56 |
| 1111 | 31 Jan
| 14
|
| 2222 | 25 Feb
| 23
|
| 3333 | 3 Jan
| 32
|
3333
| 15 Feb
| 25
|
| 3333 | 4 Mar
| 64
|
The running total field will accumulate the total in the amount field.
Account
| Date
| Amount
| Running Total |
| 1111 | 1 Jan
| 56 | 56
|
1111
| 31 Jan
| 14 | 70 |
2222
| 25 Feb
| 23
| 23
|
3333
| 3 Jan
| 32
| 32
|
3333
| 15 Feb
| 25
| 57
|
3333
| 4 Mar
| 64
| 121
|
In order to create the field "Running Total" one has to use a script:
COM****************************************************************
COM This is a standard running total with break script.
COM****************************************************************
OPEN tablename
ASSIGN v_running_total =0.00
ASSIGN v_account = blank(4)
GROUP IF v_account = account
v_running_total = v_running_total + amount
EXTRACT FIELDS ALL v_running_total as "F Running Total" TO TEMP1
v_account = account
ELSE
v_running_total = amount
EXTRACT FIELDS ALL v_running_total as "F Running Total" TO TEMP1
v_account = account
END