Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have an excel file that contains several lines of data, and for each line I need to compare two columns of the same line, please how can I proceed?
Thank you for your guidance
Hi @didi
Seems pretty straight forward for me.
Code to be used is:-
Relational.ISNULL(row1.data1) || Relational.ISNULL(row1.data2) || !(row1.data1.equals(row1.data2))? "N":"Y"
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 🙂
What is the problem you facing ?
did you use , tFileExcelInput and read/compare data ? What do you want do if the columns are same or not same ?
tFileInputExcel -- tMap/Tjava -- tFileOutputExcel
You can update same excel which you are reading.
To do that in tFileOutputExcel ,
select "Append existing excel'
Select "Append existing Sheet" and then
Select "Is absolute Y Pos." in this For C1 , X==2 and Y==0
Also Write only result data .e.g.
Input will read column A and B
tMap will compare these two value , column C should be like row1.A.equals(row1.B) ? "same" : "not same"
So tFileExcelOutput should wright only column C. not A and B
Hi @didi
Seems pretty straight forward for me.
Code to be used is:-
Relational.ISNULL(row1.data1) || Relational.ISNULL(row1.data2) || !(row1.data1.equals(row1.data2))? "N":"Y"
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 🙂
Hi Didi,
I understand that you're trying to compare 2 columns in an excel file. Please check the below job and see if it solves your problem. A tJavaRow component is added for the custom logic. Please see the custom code in the below screenshot.
Since your new question is a totally different scenario, could you please post it as a new query? Please add sample input records and expected output records with detailed description so that Community members will be interested in it.
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 🙂