You are on page 1of 4

Create Dynamic File Targets

The below solution will help you to create dynamic file targets by using Transaction Control Transformation Example: You have data coming from source table which contains regions data as shown below Region Karnataka Delhi Delhi MP Karnataka MP Product X X Z A Y Y Sales 16 05 50 15 20 22

Now you have to create separate file for each Region like 1 file for Delhi, 1 file for MP and 1 file for Karnataka. Solution: Below is the flow of mapping:

Note: In the Target file, add the Filename" port. The following transformations have been used in the mapping:
Sorter Transformation

Expression Transformation Transaction Control Transformation

Sorter Transformation The sorter transformation has been used to sort the data according to the key column. In our case, region is the key column.

Expression Transformation Expression transformation is used to filter only unique value of region. Say, if Delhi is repeating we will only pass it once. This transformation contains 2 variable ports to store and retrieve the previous value of the input port. The variable ports must be placed in the same order as shown below:

Transaction Control Transformation Put the expression in TC transformation as shown below:

You might also like