Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Do a Loop on TMap

Hi all,
I need to do a "Loop" on a TMap for write data in CSV output. 
This TMap did 3 out(CSV), and on of 1 output wanted to do a Loop (2 times) for write 2 lines. Just on 1 CSV...If do you see ^^ 0683p000009MACn.png
Thanks
Labels (2)
1 Solution

Accepted Solutions
_AnonymousUser
Specialist III

Hi,
If you are trying to print the each inputrow into a csv file (Table_obs_fluoro.csv) for multiple times (in your case 2) using tLoop, you can go ahead like this.
tMap -->tFlowtoIterate -->tLoop  -->tIterateToFlow--csv file
configure all your column names in tIterateToFlow component in a key ,value pair passion but in the value section map your column value with tFlowToIterate column name like ((String)globalMap.get("out.columnname"))

Hope that helps you.

View solution in original post

7 Replies
Anonymous
Not applicable
Author

I have not a clear idea what you are trying to do but you can create in the tMap so called joined outputs which are send their records to the real output. 
Anonymous
Not applicable
Author

I understand that there are 3 outputs from tMap. From one of the outputs (out3), you want to write the output of out3 twice in the target file. is that correct?
Thanks,
Karthikeyan J.
www.mytalend.in
Anonymous
Not applicable
Author

No, a joined output does not appears at real output outside the tMap. A joined output sends it records to the real output. This way you can use a wide schema and unfold it to build from one input record multiple output records.
Anonymous
Not applicable
Author

Hi, 
Sorry for my inglish. You can see on the picture what i want. But i dont want the TLoop on the CSV but on the TMap. Dont know how can do that. In the TMap ?! 
  0683p000009MCqy.png
Thanks
_AnonymousUser
Specialist III

Hi,
If you are trying to print the each inputrow into a csv file (Table_obs_fluoro.csv) for multiple times (in your case 2) using tLoop, you can go ahead like this.
tMap -->tFlowtoIterate -->tLoop  -->tIterateToFlow--csv file
configure all your column names in tIterateToFlow component in a key ,value pair passion but in the value section map your column value with tFlowToIterate column name like ((String)globalMap.get("out.columnname"))

Hope that helps you.
Anonymous
Not applicable
Author

Hey ! So nice  0683p000009MACJ.png
Its that, and Job OK ! Good explain.
Good day, 
Best regards all.
Anonymous
Not applicable
Author

I have 2 JDBC Input tables - tJDBCInput (for example student and course). The student table has an primary key which will used as foreign key in course table. So If any student studying more than one course, we'll have multiple entry in course table for that student id.
I want to get all those multiple entries which are matching with student id and store it in another table.
I am new to Talend, Can some one please help me. It is really appreciated. Thanks
 
Thanks and Regards,
Ram