Calculating Hash Totals

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

  1. Double-click the field that you typically use to count the line items.

    The Field Properties dialog box opens.

  2. Click the Standard Rule tab to access the standard rule options.
  3. From the standard rule list, select Use Accumulator.
  4. Click New.

    The Edit Accumulator Entry dialog box opens to create a new calculation for this field.

  5. From the Primary Accumulator list, select 1.
  6. In the Name box, type Total Quantity.
  7. 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.

  8. In the Edit Accumulator dialog box, click OK to add the accumulator.
  9. In the Field Properties dialog box, click OK to add the standard rule to the Line Items field.
  10. Double-click the field that typically contains the total quantity of the purchase order.

    The Field Properties dialog box opens.

  11. Click the Standard Rule tab to access the standard rule options.
  12. From the standard rule list, select Use Accumulator.
  13. Click New.

    The Edit Accumulator Entry dialog box opens to create a new calculation for this field.

  14. From the Primary Accumulator list, select 1.

    This accumulator currently contains the total quantity.

  15. From the First list, select Use primary.

    Use primary specifies that the current value of the accumulator is loaded into the Hash Total field.

  16. In the Edit Accumulator dialog box, click OK to add the accumulator.
  17. 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.