Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
lmit
Creator II
Creator II

Different flows using a special character

Hi All,

I have a input file which has a data like
1,a~b~c,xyz

Based on the special character my data should be going into different flows like
1,a,xyz ( as 1st flow if I use tmap component)
1,b,xyz (as 2nd flow )
1,c,xyz (as 3rd flow)

Am not saying about the output which we get tNormalize component where the 3 rows will be in one flow or file

But I want 3 different flows how can I achieve this

Any help would be great

Thanks in advance,
Lmit
Labels (2)
4 Replies
Anonymous
Not applicable

Hi,

 

    The easy way is to assign a sequence number for each group and separate the data based on the sequence number value in output section.

 

    In normal case, you will have sequence like below

 

Numeric.sequence("s1", 1, 1) 

 But in your case, add your primary key as the factor to determine the sequence. But make sure that id value is in String format.

 

Numeric.sequence(row1.id, 1, 1) 

Once you get a sequence number, you can control the flow by adding filter condition in output by checking the reminder of sequence value. For a three way sequence, you need to take the reminder of row1.seq%3 and check it as 0,1 or 2.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

lmit
Creator II
Creator II
Author

Hi Nikhil,

Thanks for the reply but I have records which need not be spilt so how will I know which number sequence I should divide

Thanks,
Lmit
Anonymous
Not applicable

Hi,

 

    I would say, do the split first using tnormalize and then group them.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

lmit
Creator II
Creator II
Author

Hi,

If I group them then I will get all 3 records in one file as they will be having same id

Thanks,
Lmit