The Number 1 independent website for ACL information!

TexasACL User Group
About Us
Training
Why ACL
Essays & Scripts
ACL News
Events
Links
FAQ
Site Map
Support Us
A running total is  a field that accumulates values by adding the current value with a previous total:

 AccountDate
Amount
11111 Jan
 56
111131 Jan
14
222225 Feb
23
33333 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
 5656
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