Standard Rule Tab - Use Accumulator Function
The Use Accumulator function gives you access to a set of numeric variables that you can manipulate via numeric operations, and then transfer to and from elements or fields. This function enables you to add, change, or delete calculations for the element, field, or TFD, including hash totals (used to accumulate numeric field values, for example, quantity and price).
This function also enables you to map or load the accumulated total into a control total field or element. Accumulators are used generally for counting the occurrences of a specific element or generating increasing or sequential record or line item numbers.
Notes:
- Accumulators are global variables.
- Accumulators are set to zero before being used in calculations.
- The order in which accumulator operations are performed depends on the hierarchical order of the components.

| Part | Function |
|---|---|
| Primary accumulator | Lists existing accumulators and their associated operations that were created for this element, field, or TFD. |
| New | Accesses the Edit Accumulator Entry dialog box to define an accumulator for this element, field, or TFD. |
| Change | Highlight a calculation in the Primary Accumulator list and click this to access the Edit Accumulator Entry dialog box to edit the selected accumulator. |
| Delete | Highlight a calculation in the Primary Accumulator
list and click this to delete the selected accumulator. Note: The selected
calculation is deleted without warning.
|
| Part | Function |
|---|---|
| Primary accumulator | Specifies the primary accumulator. Notes:
|
| Name | Contains a descriptive alias that enables you to differentiate what the accumulators you create are used for. |
| First | Specifies the first operation that the system
performs. Notes:
|
| Second | Specifies the second operation that the system performs, after the First operation is completed. The Second box is active only after you select a First operation that does not involve the Alternate Accum. |
| Third | Specifies the third operation that the system performs, after the Second operation is complete. The Third box is active only after you select a Second operation. |
| Fourth | Specifies the fourth operation that the system performs, after the Third operation is complete The Fourth box is active only after you select a Third operation. |
| Alternate Accum | Specifies an alternate accumulator that participates in the accumulator operation. The Alternate Accum box is only active if you select an operation from the First field that involves an alternate operand. |
| Part | Function |
|---|---|
| Increment primary | Adds 1 to the contents of the Primary Accumulator (Primary = Primary + 1). |
| Decrement primary | Subtracts 1 from the contents of the Primary Accumulator (Primary = Primary - 1). |
| Sum in primary | Adds the numeric value (takes the positive or negative sign of the numbers into account) of the field to the contents of the Primary Accumulator (Primary = (+/-)Primary + (+/-)Field). |
| Hash sum in primary | Adds the absolute value (does not take the positive or negative sign of the numbers into account) of the field to the contents of the Primary Accumulator (Primary = Primary + Field). |
| Load primary | Loads the contents of the field into the Primary Accumulator (Primary = Field). |
| Use primary | Loads the contents of the Primary Accumulator into the field (Field = Primary). |
| Zero primary | Sets the value of the Primary Accumulator to zero (Primary = 0). |
| Multiply with primary | Multiplies the field with the contents of the Primary Accumulator, and stores the result in the Primary Accumulator (Primary = Primary * Field). |
| Divide by primary | Divides the field with the contents of the Primary Accumulator, and stores the result in the Primary Accumulator (Primary = Field / Primary). |
| Divide primary by field | Divides the contents of the Primary Accumulator with the field, and stores the result in the Primary Accumulator (Primary = Primary / Field). |
| Modulo with primary | Divides the contents of the Primary Accumulator with the contents of the field, and stores the remainder of that operation in the Primary Accumulator (Primary = Field % Primary). |
| Modulo with field | Divides the contents of the field with the contents of the Primary Accumulator, and stores the remainder of that operation in the Primary Accumulator (Primary = Primary % Field). |
| Negate primary | Makes the contents of the Primary Accumulator
negative (Primary = Primary * -1). Note: The only way to subtract the
Primary Accumulator from the field is to "Negate" the Primary Accumulator
and then use the "Sum in primary" operation to add the negative Primary
Accumulator to the field.
|
| Move primary to alternate | Copies the contents of the Primary Accumulator to the Alternate Accum. This overwrites the current contents of the Alternate Accum field (Alternate = Primary). |
| Add primary to alternate | Adds the contents of the Primary Accumulator to the contents of the Alternate Accum and stores the result in the Primary Accumulator (Primary = Primary + Alternate). |
| Multiply primary by alternate | Multiplies the contents of the Primary Accumulator with the contents of the Alternate Accum and stores the result in the Primary Accumulator (Primary = Primary * Alternate). |
| Divide primary by alternate | Divides the contents of the Primary Accumulator with the contents of the Alternate Accum and stores the result in the Primary Accumulator (Primary = Primary / Alternate). |
| Modulo primary with alternate | Divides the contents of the Primary Accumulator with the contents of the Alternate Accum and stores the remainder of that operation in the Primary Accumulator (Primary = Primary % Alternate). |