Home » Router Transformation

Router Transformation

by Online Tutorials Library

Router Transformation

Router transformation is an active and connected transformation, and it is similar to the filter transformation, which is used to filter the source data.

In a Router transformation, Data Integration is used as a filter condition to evaluate each row of incoming data. It checks the conditions of each user-defined group before processing the default group.

If a row connects more than one group filter condition, Data Integration passes the row multiple times. We can drop rows that do not meet any of the conditions to a default output group.

If we need to check the same input data based on multiple conditions, then we use a Router transformation in a mapping instead of creating multiple Filter transformations.

The following table compares the Router transformation to the Filter transformation:

Options Router Filter
Conditions Test for multiple conditions in a single Router transformation Check for one condition per Filter transformation
Handle rows that do not meet the condition Route rows to the default output group or drop rows that do not meet the condition Drop rows that do not meet the condition
Incoming data The process once with a single Router transformation Process in each Filter transformation

For example, when filtering the data form rollno =20, we can also get those records where rollno is not equal to 20. So, router transformation gives multiple output groups, and each output group can have its filter condition.

Also, there is a default group, and this default group has record sets that don’t satisfy any of the group conditions.

For example, if we have created two groups for the filter conditions rollno=20 & rollno=30 respectively, then those records which are not having rollno 20 and 30 will be passed into this default group.

The data which is rejected by the filter groups will be collected by this default group, and sometimes there can be a requirement to store these rejected data. In this way, the default output group can be useful.

To allow multiple filter conditions, the router transformation provides a group option.

  • There is a default input group that takes input data.
  • There is also a default output group that contains all those data which are not passed by any filter condition.
  • For every filter condition, an output group is created in router transformation. We can connect different targets to these different groups.

Creating Router Transformation

Follows the following steps to create the router transformation, such as:

Step 1: Create a mapping having source “STUD” and target “STUD_TARGET.”

Step 2: Then in the mapping

  1. Select Transformation menu.
  2. Click on the Create

Step 3: In the create transformation window

  1. Select router transformation
  2. Enter a name for the transformation “rtr_rollno_20”
  3. And click on the Create

Step 4: The router transformation will be created in the mapping, select done option in the window.

Step 5: Drag and drop all the columns from Source qualifier to router transformation.

Step 6: Double click on the router transformation, then in the transformation property of it

  1. Select the group tab.
  2. Enter the group name rollno_30.
  3. Click on the group filter condition.

Step 7: In the expression editor, enter the filter condition rollno=30 and select the OK button.

Step 8: Click on the OK button in the group window.

Step 9: Connect the ports from the group rollno_30 of router transformation to target table ports.

Now, when we execute this mapping, the filtered records will get loaded into the target table.


You may also like