One Star

[resolved] How to route data to different targets based on conditions

Hi,
Please let me know component name used to divide source data based on given conditions. For example if I have 10 ids in source so I want to route 5 ids to one flow and 5 to another flow based on filter conditions. Means how to route data to different flows based on given condition,
Thanks,
6 REPLIES
One Star

Re: [resolved] How to route data to different targets based on conditions

Hi inabi,
U can use tMap component to route he data to different flows based on the conditions. On the target side , there is expression filter ( Activate/Unactivate Expression filter). U can give ur condition here on every target flow.

Hope this would be helpful to u.
Thnx,
Saty.
One Star

Re: [resolved] How to route data to different targets based on conditions

I also tried it but not giving output as desired. Simply i am reading data from xml file in which i have field Flag and value (Yes or No). I want to load Yes records to one target and No to another target. In tMap component i am giving simple codition like
row1.flag=="Yes" for one target
row1.flag=="No" to another target
But none of the target is populated. Eventhough I have kept filter expression Activated.
Pls help.
Community Manager

Re: [resolved] How to route data to different targets based on conditions

I also tried it but not giving output as desired. Simply i am reading data from xml file in which i have field Flag and value (Yes or No). I want to load Yes records to one target and No to another target. In tMap component i am giving simple codition like
row1.flag=="Yes" for one target
row1.flag=="No" to another target
But none of the target is populated. Eventhough I have kept filter expression Activated.
Pls help.

If the datatype is String, you should use the method row1.flag.equals("yes") instead of row1.flag=="Yes".
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Employee

Re: [resolved] How to route data to different targets based on conditions

"yes".equals(row1.flag) is another option Smiley Happy
I prefer this way, because it avoids an exception if row1.flag was null Smiley Happy
Regards,
Olivier
One Star

Re: [resolved] How to route data to different targets based on conditions

Thanks to all
One Star

Re: [resolved] How to route data to different targets based on conditions

Hi all,will anybody tell me how can we get cumulative salary result