Skip to main content Skip to complementary content

Flattening a hierarchical structure

This feature allows you to create a CSV-like flat structure from an existing hierarchical structure.

Information noteNote: This option is no longer available if you have installed the R2020-04 Studio monthly update or a later one delivered by Talend. For more information about the updated flattening feature, see Creating a flattening map.

Before you begin

  • You have created a hierarchical structure.

About this task

In this example, the input hierarchical structure looks like this:

Procedure

  1. In the Data Mapper tab of the Mapping perspective, right-click Structure in Hierarchical Mapper and click New > Structure.
  2. Select Create a flattened structure from another structure and click Next.
  3. Select the structure that you want to flatten and click Next.
  4. Select a folder and enter a name for the new structure, then click Next.
  5. Optional: Change the pivot by right-clicking the relevant node and clicking Set Pivot.

    The pivot is a path of nodes that starts at the root node and ends at a leaf node. The selected pivot determines the number of rows in the flattened structure.

    You can also remove a node from the pivot by right-clicking it and clicking Remove From Pivot.

  6. Optional: Change the value of the Max Occurs attribute for elements that are not in the pivot.
    • Click the Set Max Occurs for all repeatable elements button to change the value for all repeatable elements.
    • Select one or several nodes and right-click them, then select Set Max Occurs and enter a number. You can select the Apply max occurs to descendant(s) check box if you want to apply this setting to all the descendants of the nodes you selected, then click OK.
  7. Click Next, select the Create a Studio schema from the flattened structure check box if needed, then click Finish.
    Information noteNote: If you select this check box, the output structure will use the Map representation by default. If you clear it, the output will use the CSV representation.

Results

Your flattened structure is created in the selected folder.

In this example, it looks like this:

If you selected Create a Studio schema from the flattened structure, a schema containing the same columns is created. You can find it in your Repository in the Integration perspective, under Metadata > Generic schemas.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!