About this task
In
this example, you want to count the quantity ordered for each line
item and load the total quantity in the Hash Total field.
To count the quantity ordered and generate a hash total
for a purchase order:
Procedure
- Double-click the field that you typically
use to count the line items.
The Field Properties dialog box opens.
- Click the Standard Rule tab
to access the standard rule options.
- From the standard rule list, select Use
Accumulator.
- Click New.
The Edit Accumulator Entry dialog box
opens to create a new calculation for this field.
- From the Primary Accumulator list,
select 1.
- In the Name box, type Total Quantity.
- From the First list, select Sum
in primary.
Sum in primary specifies that the numeric
value of the field (taking the positive or negative sign of the numbers
into account) is added to the contents of the primary accumulator
for each iteration of the current group.
- In the Edit Accumulator dialog
box, click OK to add the accumulator.
- In the Field Properties dialog
box, click OK to add the standard rule to the
Line Items field.
- Double-click the field that typically contains
the total quantity of the purchase order.
The Field Properties dialog box opens.
- Click the Standard Rule tab
to access the standard rule options.
- From the standard rule list, select Use
Accumulator.
- Click New.
The Edit Accumulator Entry dialog box
opens to create a new calculation for this field.
- From the Primary Accumulator list,
select 1.
This accumulator currently contains
the total quantity.
- From the First list, select Use
primary.
Use primary specifies that the current
value of the accumulator is loaded into the Hash Total field.
- In the Edit Accumulator dialog
box, click OK to add the accumulator.
- In the Field Properties dialog
box, click OK to add the standard rule to the
Hash Total field.
The Hash Total field now contains the
total quantity of the purchase order.