Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
idembel2
Creator
Creator

Merge columns of a file

Morning Guys,

 

I have a file looks like bellow and i want to merge all rows which have the same ID (first column) in a single row.

ID	Test_1	Date_test_1	Test_2	Date_test_2	Test_3	Date_test_3
1	yes	06/09/2017	 	 	 	 
4	no	 	yes	20/04/2004	 	 
4	 	01/10/2000	 	 	yes	17/05/1982
1	 	 	no	02/02/2015	 	 

 

I try to use tAggregateRow component but it does not help in my situation; because colums can contain or not data and i have not function to extract it.

I want to get an output like bellow.

 

I also see on this link : https://help.talend.com/reader/ZndcSsDNtKg8FpNIRCdjag/jPZNgHRF5ad4KUp4Mpvzkg

Which suggest to use component tSurviveFields but it does not present on Studio and not on talend Exchange

 

ID	Test_1	Date_test_1	Test_2	Date_test_2	Test_3	Date_test_3
1	yes	06/09/2017	no	02/02/2015	 	 
4	no	01/10/2000	yes	20/04/2004	yes	17/05/1982

 

Thank you for help,

Labels (2)
20 Replies
idembel2
Creator
Creator
Author

Hello TRF,

Trying to import your job in my studio, i get this message0683p000009Lwfx.png

 

 

TRF
Champion II
Champion II

Hi,

You probably use a version prior mine.

I use Talend Open Studio for Data Integration Version 6.4.1.

Let me know your version?

idembel2
Creator
Creator
Author

Hello TRF,

 

Yes you are right, i have a prior vesion than yours.

I use 6.3.1

 

Thanks,

TRF
Champion II
Champion II

Here is the job redesigned with version 6.3.1.

I got the same result as with 6.4.1.


orga_britton_631.zip
idembel2
Creator
Creator
Author

Hi TRF,

 

I confirm that your job work fine.

I know now why it does not work, it is very strange but i mean it regards the component tFileInputDelimited.

You know i just replace component tFixedFlowInput to tFileInputDelimited and i don't get good result.

 

I post this job here, you can check it. I use the same input file that i put in my post

And you need to change file path. 

 

Thanks,


orga_britton_InputDelimited.zip
TRF
Champion II
Champion II

The reason is that fields are empty ("") when they come from tFileInputDelimited instead of null.

Try to include a tJavaRow after tFileInputDelimited to replace empty strings by null using this example:

output_row.Organization_Name = input_row.Organization_Name.equals("") ? null : input_row.Organization_Name.equals("")
idembel2
Creator
Creator
Author

Hello TRF,

 

You are a great guy, you are a professor.

Big respect and thank you very much for help.

It resolves.

TRF
Champion II
Champion II

You're welcome.
Based on the schema for your file it seems you speak french, don't you? Where're yoy from?
idembel2
Creator
Creator
Author

Hello TRF,

 

Yes you saw correctly, i  leave in Paris and you ?

 

 

TRF
Champion II
Champion II

Same as you 0683p000009MA9p.png