This article explains how to make an order by in a mapping when loading hierarchical files.

 

The metadata

The hierarchical file we are loading looks like this:

 fileMetadata

See this article if you need help to make it.

Our goal is to order the data by TIT_CODE when loading the file from the demo database.

 

The mapping

The mapping is very similar to what we would usually do when loading a hierarchical file.

The source fields are mapped to the target and all the records are mapped with a repetition key.

mapping

Now, to order the customers by TIT_CODE, we are going to modify the expression of the customer record node.

The idea is to concatenate all the columns we would have put in an ORDER BY SQL Query.

We set it here to CONCAT(T_CUSTOMER.TIT_CODE, T_CUSTOMER.CUS_ID).

The data will then be ordered by TIT_CODE and CUS_ID

updatedMapping