Router Transformation in Informatica: Multiple Conditions Example

What is Router Transformation?

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

The additional functionality provided beside filtering is that the discarded data (filtered out data) can also be collected in the mapping, as well as the multiple filter conditions can be applied to get multiple sets of data.

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

In addition there is also a default group, this default group has those record sets which doesn’t satisfy any of the group conditions. For example, if you have created two groups for the filter conditions deptno=10 & dept=20 respectively, then those records which are not having deptno 10 and 20 will be passed into this default group. In short 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 such scenarios, default output group can be useful.

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

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

Creating Router Transformation

Step 1) Create a mapping having source “EMP” and target “EMP_TARGET.”

Router Transformation in Informatica

Step 2) Then in the mapping

  1. Select Transformation menu
  2. Select create option

Router Transformation in Informatica

Step 3) In the create transformation window

  1. Select router transformation
  2. Enter a name for the transformation “rtr_deptno_10”
  3. Select Create option

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

Router Transformation in Informatica

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

Router Transformation in Informatica

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

  1. Select group tab
  2. Enter group name “deptno_20”
  3. Click on the group filter condition

Router Transformation in Informatica

Step 7) In the expression editor, enter filter condition deptno=20 and select OK button.

Router Transformation in Informatica

Step 8) Select OK button in the group window

Router Transformation in Informatica

Step 9) Connect the ports from the group deptno_20 of router transformation to target table ports

Router Transformation in Informatica

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