Flatten

Flatten does the opposite of the hierarchy transform.

Flatten takes either a full dataset or a parent and its children, and transforms it into a flat structure. The result of a flatten transform is a Cartesian Product of the records participating in the transform.

While hierarchy adds records to the data structure, flatten removes them.

Example

In the diagram below, there are two examples.

In the first, a two level hierarchical structure with two transaction types is transformed into a flat dataset with a single transaction type. This occurs at the topmost parent level.

In the second example below, a four level hierarchy is transformed into a two level hierarchy at the child level of transaction B.

Flatten > Field Mapping

First select the Transaction Id to Flatten. In the examples above, these would have been TransactionA and ChildA respectively.

Press refresh to update the preview screen, and the fields in the selected Transaction Id will appear in the grid.

Import Tran Id

The transaction Id the field belongs to before flattening.

Import Field

The currently assigned field name before flattening.

Import

  • True
    • The field will be kept
  • False
    • The field will be dropped

New Name

The new name assigned to the field after transformation.

The value of this field defaults to its existing name, except where there is a naming conflict. A conflict would occur when fields from two or more levels being flattened have the same name. E.g. OrderNo. The first field would be called OrderNo, the second would be renamed OrderDetails_OrderNo where OrderDetails is the transaction Id that the field belonged to before it is flattened.

Flatten > Audit

Supported Counters

  • PROCESSED
    • Incremented for each record being flattened during the transform.

Action on Transform Error

Any errors, irrespective of the setting, will cause the transform to abort.

Use V3 Logic

This option is only displayed when the integration has been upgraded from version v3.2 and below. When selected the continue to the inconsistent logic (link to change notice) per previous versions. This option cannot be re-enabled if the option is deselected and the transform saved.

Use Strict Join Logic

This option controls how the flatten transform handles the ‘joining’ of the child records to the parent.

  • When selected the flatten transform works similarly to an ‘inner join’ in SQL. The transform will drop both the parent and child records if one of the child transaction types has no records. This is analogous to the inner join in SQL should one of the sets/tables being joined has no records, the inner join will return no records.
  • When deselected the flatten transform works similarly to an ‘outer join’ in SQL. Where a child transaction type has no records, the transform will retain the parent record. In this instance the fields from the child transaction will be empty.