Scenario 6: Classifying the output data with aggregate element - 6.1

Talend Components Reference Guide

Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
Talend Studio
Data Governance
Data Quality and Preparation
Design and Development

Based on Scenario 5: Mapping data using a group element, this scenario presents how to set up an element as aggregate element in the Map Editor of tXMLMap to classify the output data into separate XML flows. For more information about how to aggregate the output data using tXMLMap, see Talend Studio User Guide.

The objective of this scenario is to classify the customer id and the customer name information using an aggregate element in accordance with the states they come from and then to send these classes separately in different XML flows to the next component.

To put an aggregate element into effect, the XML data to be processed should have been sorted, for example via your XML tools, around the element that will be used as the aggregating condition. In this example, the customers possessing the same state id should be put together. The input data in the XML file Customer.xml should be same as the input data in Scenario 5: Mapping data using a group element.

  1. In your Studio, open the Job used in Scenario 5: Mapping data using a group element, and double-click the tXMLMap component to open its Map Editor.

  2. Right-click the customer element in the output table and select Remove group element from the contextual menu.

  3. On the top of the output table, click the wrench icon and set the value of the All in one property to false.

  4. Right-click the LabelState element and select As aggregate element from the contextual menu. The LabelState element tags the state information of each customer and the customer information will be classified according to the state information.


    To make the aggregate element available, ensure that the value of the All in one property is set to false. For further information about the All in one feature, see Talend Studio User Guide.

  5. Click OK to validate the changes and close the Map Editor.

  6. Press Ctrl+S to save the Job and then F6 to run the Job.

As shown above, tXMLMap outputs two separate XML flows, each of which carries the information of one state and the customers from that state.