Alternate between Source Records for Mapping Rule


How can we alternate between records from an incoming file to be assigned equally to different people on the target side?



By using the position and mod functions, you can alternate between incoming records to have the target’s mapped value change equally based on the mod function.

You can build a textual rule with the When Condition, Position and Mod functions as follows:


WHEN CONDITION{ (position( ) mod 2  = 1 )} VALUE=[ ‘Dave’ ] OTHERWISE VALUE=['Mike ' ]


This will alternate between 2 mapped values and assign the appropriate value based on the position of each record.




Record 1 target element value = Dave

Record 2 target element value = Mike

Record 3 target element value = Dave

Record 4 target element value = Mike


And so forth


More values can be assigned for the target, therefore changing how the records will be split proportionately, by modifying the number of When Conditions and mod # = # logic.




WHEN CONDITION{ (position( ) mod 3  = 1 )} VALUE=[ ‘Dave’ ]
WHEN CONDITION{ (position( ) mod 3  = 2 )} VALUE=[ ‘Sam’]



Have more questions? Submit a request


Article is closed for comments.