ACCUMULATE statement
Calculates one or more aggregate values of an expression during the iterations of a block. Use the ACCUM function to access the result of this accumulation.
Syntax
expression
An expression for which you want to calculate the aggregate value. The expression you use in the ACCUMULATE statement and the expression you use in the ACCUM function (when using the result of the ACCUMULATE statement) must be in exactly the same form. (For example, “A * B” and “B * A” are not in exactly the same form.)aggregate-phrase
Identifies one or more values to calculate based on a change in expression or a break group. This is the syntax foraggregate-phrase
:
For more information, see the Aggregate phrase reference entry.ExamplesThis procedure calculates and displays statistics for all customers, but does not show the detail for each customer.
The following procedure lists each item with its inventory value and lists that value as a percentage of the total inventory value of all items; it sorts items by highest value.
The following procedure displays all customers, sorted by salesrep and country within the list for each salesrep. The procedure calculates the balance for each customer, total balance for each country, and total balance for each salesrep.
NoteYou can use the ACCUMULATE statement only in blocks with the implicit looping property. ABL automatically supplies looping services to REPEAT and FOR EACH blocks. See OpenEdge Getting Started: ABL Essentials for more information on block properties.
See also
OpenEdge Release 10.2B
|