6.2 – Aggregate Transform¶
The Aggregate transform can:
- Create records derived from the other records in a node.
- Create records that are not part of the original dataset.
Example of use¶
- Create a balancing detail line for a POS sales journal that is the negative sum of the other records.
- Create a VAT record that sums the VAT amount fields of the other records.
- Consolidate many lines of an invoice or journal into a single record.
- Create shipping charge or comment lines from values held, for example, in a header record.
This step does the last one. The workbook carries the assembly, two-man delivery and carriage charges as three columns on the order header, and Sage 300 needs them as order lines. The Aggregate moves them.
Design > Transform Setup¶
- Open the Transforms group in the palette and drag an Aggregate transform onto the design surface.
-
Drag a Connector from the same group, then drag its ends onto the Map transform and the Aggregate to join them.
The Map now feeds two transforms: the Sage 300 customer import built in step 5 and this Aggregate.
Transform > Setup¶
Priority appears only once a transform has a sibling
Priority Field¶
IMan shows the Priority field only when two or more transforms are connected to the same parent transform. Priority controls the order in which they run.
It appears here because the Map transform now has two children. It was not on the Map's own Setup tab in step 4, when the Map was the only transform connected to the Hierarchise.
Transform > Field Mapping¶
- Press the Field Mapping tab and change the Current Transaction Id to
OrderDetails.- The charge lines are order details, so you build them on the OrderDetails transaction with the fields added in 6.1.
- Press the + button beside Calc Records to create a record.
-
Give it a recognisable name in Description.
- For training, enter: Assembly
- Delete Child Records
- Removes the records the calc records are derived from, and keeps only the created ones. For training, leave unticked. You need the order lines as well as the charges.
- Calc Records
- Every record this transform creates. The + adds one and the − deletes the selected one after you confirm.
- Description
- The name of the selected calc record. It identifies the record in the list, so make it recognisable.
- Record Inclusion Condition
- A formula that decides whether IMan creates the record. It defaults to
True. For training, leave it. Every order gets all three charge records, and 6.3 removes the ones with no value.
- A formula that decides whether IMan creates the record. It defaults to
-
Set each field by double-clicking its row in the grid. For the
Assemblyrecord:Field Name Evaluate Evaluate String LineType ✘ 2Description ✘ AssemblyExtendedPrice ✔ GetParent("AssemblyCharge", "Orders")MiscChargeId ✘ PACKLineTypeis2, the Sage 300 line type for a miscellaneous charge. The order lines from the workbook carry1.ExtendedPriceis the only evaluated field.GetParentreads a field on the parent order of the line being created. The workbook holds the charge there.
-
Press the tick to save each field. With all four set the record reads:
Leave every other field blank. A calc record is derived from the records already in the node. The fields you do not set here carry through from the order's first detail line. A charge line therefore arrives holding that line's
SkuCodeandQtyas well as its ownOrderId. -
Press + again and build the other two records the same way:
Description LineType Description field ExtendedPrice (evaluated) MiscChargeId TwoManSupplement 2Two Man SupplementGetParent("TwoManDeliverySupplement", "Orders")PACKDelivery 2DeliveryGetParent("Delivery", "Orders")PACK -
When you finish, the Calc Records drop-down has three entries.
-
Press Refresh.
- Expand an order in the preview. It shows three extra detail lines beneath
the item lines:
Assembly,Two Man SupplementandDelivery. Each carriesLineType2 and the charge from the order header. On the first order onlyDeliveryhas a value. The other two charges are0, and 6.3 filters them out.
- Expand an order in the preview. It shows three extra detail lines beneath
the item lines:
-
Press Close at the bottom of the transform, then Save the integration.





