Let see how to create a mapping logic for this in informatica with an example. Consider the following source flat file as an example:
Products --------- Informatica Datastage Pentaho MSBI Oracle Mysql
The data in the targets should be:
Target1 ------- Informatica Pentaho Oracle Target2 ------- Datastage MSBI Mysql
The mapping flow and the transformations used are mentioned below:
- First create a new mapping and drag the source into the mapping.
- Create an expression transformation. Drag the ports of source qualifier into the expression transformation. Create the following additional ports and assign the corresponding expressions:
v_count (variable port) = v_count+1 o_count (output port) = v_count
- Create a router transformation and drag the ports (products, v_count) from expression transformation into the router transformation. Create an output group in the router transformation and specify the following filter condition:
MOD(o_count,2) = 1
- Now connect the output group of the router transformation to the target1 and default group to target2. Save the mapping.
This is how we have to load alternative records into multiple targets.