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.
Standard Rule tab displaying the Use Accumulator rule
Table 1. Use Accumulator standard rule parts and functions
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.
Table 2. Edit Accumulator Entry dialog box parts and functions
Part Function
Primary accumulator Specifies the primary accumulator.
Notes:
  • Before any calculations are performed on an accumulator, its content is 0. When you use an accumulator, the system adds a new accumulator to the bottom of this list.
  • There is only one set of accumulators for each map or form. This means that accumulator 0, whether it is used in the Primary Accumulator or Alternate Accum box is the same accumulator with the same contents. If you assign calculations to accumulator 0 at the beginning of the map/form and then use accumulator 0 again later, the content of that accumulator is the result of the earlier calculation. Any additional calculations you assign to that accumulator are performed on the contents resulting from an earlier calculation.
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:
  • The First box is active only after you select a Primary Accumulator.
  • Before any calculations are performed on an accumulator, its content is 0. When you use an accumulator, the system adds a new accumulator to the bottom of this list.
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.
Table 3. Accumulator operations and functions
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).