6.2 - Aggregate Transform
The aggregate transform allows you to:
- Create records which are derivatives of other records in a particular node.
- Create record(s) which are not part of the original dataset.
Example of use
- Create a Balancing detail line for a POS sales journals which is a negative sum of the other records.
- Create a VAT record which is a sum of other VAT amount fields for the other records.
- Consolidate into a single record many lines of an invoice or journal.
- Create shipping charge or comment lines from values for example located in a header record.
Priority Field
The Priority field is only displayed for transforms where there are 2 or more transforms connected to a parent transform. The priority field is used to control the order of processing.
Creating new records
- Add an Aggregate transform; connect it to the Map transform and; open its setup.
- Change the current transaction Id to 'OrderDetails'.
- Press the Add button.
- Assign a recognisable name to identify the record.
- For training, enter: Assembly
- Set the fields to following values, by double clicking the relevant field in the grid:
- Field Name
- LineType
- Enable Script Evaluation
- Unchecked
- Formula
- 2
- Press the green tick. Add the following fields:
- Field Name
- Description
- Enable Script Evaluation
- Unchecked
- Formula
- Assembly
- Field Name
- ExtendedPrice
- Enable Script Evaluation
- Checked
- Formula
- GetParent("AssemblyCharge", "Orders")
- Field Name
- MiscChargeId
- Enable Script Evaluation
- Unchecked
- Formula
- PACK
- Press the green tick.
- Press Refresh. Expand an order and you will see an additional detail line per order:
- Now create another Calc Record, by pressing the Add button.
- Assign a recognisable name to identify the record.
- For training, enter: TwoManSupplement
- Set the fields to following values, by double clicking the relevant field in the gird:
- Field Name
- LineType
- Enable Script Evaluation
- Unchecked
- Formula
- 2
- Field Name
- Description
- Enable Script Evaluation
- Unchecked
- Formula
- Two Man Supplement
- Field Name
- ExtendedPrice
- Enable Script Evaluation
- Checked
- Formula
- GetParent("TwoManDeliverySupplement", "Orders")
- Field Name
- MiscChargeId
- Enable Script Evaluation
- Unchecked
- Formula
- PACK
- Save.
- Finally create the last ‘Calc Record’ for the Delivery charge.
- Press the Add button, and assign a recognisable name to the record.
- For training, enter:
- Delivery
- Set the fields to the following values, by double clicking the relevant field in the gird:
- Field Name
- LineType
- Enable Script Evaluation
- Unchecked
- Formula
- 2
- Field Name
- Description
- Enable Script Evaluation
- Unchecked
- Formula
- Delivery
- Field Name
- ExtendedPrice
- Enable Script Evaluation
- Checked
- Formula
- GetParent("Delivery", "Orders")
- Field Name
- MiscChargeId
- Enable Script Evaluation
- Unchecked
- Formula
- PACK
- Press Save
- Once complete there will be three items in the Calc Records drop down:
- Refresh, and expand the last order.
Each miscellaneous record now appears on its own line with the corresponding value.
- Close the setup window and save the integration.