Transformations > Hierarchy Processor transformation > Configuring output groups and fields
  

Configuring output groups and fields

You can create and modify output groups and output fields. If the output is relational, you can create multiple output groups. If the output is hierarchical, there is one output group.
After you add incoming fields to an output group, you can modify the fields by clicking on the output field name on the Hierarchy Processor tab. You can also add and define output fields manually.
Note: The output field properties that appear depend on the data type.
The following table describes the properties for output fields:
Property
Description
Child Of
The parent field or group that this field belongs to. The name structure describes the group, parent fields, and struct name. For example: OUTGROUP.Grandparent.Parent.struct_name
Name
The name of the current output group or field.
Type
The data type of the current field. For relational output, you can choose a primitive data type. For hierarchical output, you can choose either a primitive or complex data type.
Precision
The total number of significant digits in the field.
Scale
The number of digits to the right of the decimal point.
Array Element Type
The data type of the current array element.
Array Element Precision
The precision for the current array element. Used when creating the target data.
Array Element Scale
The scale for the current array element. Used when creating the target data.
Struct Name
The struct name for the current struct field.
Element Struct Name
The element struct name for the current array of structs field.
Description
Optional description of the field and its usage.
The following table describes the properties for aggregating output data:
Property
Description
Aggregate Options: Optionally, use this field to aggregate values in an output field array.
Indicates that you want to aggregate output data into the current field.
Output Field
Specify the sibling array with fields to aggregate. The array must be a child of the current output field or group.

Aggregating values in an output field array

If the transformation output contains an array, you might want to add an output field to aggregate values in the array. The output field must be a sibling of the array field.
For example, the Output group contains an array with orders information. The Orders array contains the OrderPrice field, which stores the price for each order. You want to find the total order price for each company.
The following image shows the output fields:
The image shows the Output Fields panel of the Hierarchy Processor tab of the Hierarchy Processor transformation. The Output Fields panel contains one output group with the following fields: CompanyName (string), Orders (array), and TotalOrderPrice (double). The Orders array struct contains the following fields: OrderPrice (double), OrderDate (string), Items (array), and OrderAddress (struct).
To find the total order price, add a field called TotalOrderPrice to the output group.
Edit the TotalOrderPrice field. Select Use this field to aggregate values in an output field array, and select the Orders array as the output field for which you want to aggregate values. Configure the following expression for the TotalOrderPrice field:
SUM(:fld.{Output.Orders.Orders.OrderPrice})