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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

comparison between two columns of the same excel file

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

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi @didi 

 

Seems pretty straight forward for me.

 

0683p000009M3T4.png

 

0683p000009M3TE.png

 

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 🙂

View solution in original post

7 Replies
akumar2301
Specialist II
Specialist II

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 ?

 

Anonymous
Not applicable
Author


thank you for your reply,
Yes I use an tFileExcelInput ,
If the columns are similar I create another column to say it's ok
if it is not similar I must also create a column to say that it's not ok

THANKS
DIDI
akumar2301
Specialist II
Specialist II

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

 

 

 

 

Anonymous
Not applicable
Author

Hi @didi 

 

Seems pretty straight forward for me.

 

0683p000009M3T4.png

 

0683p000009M3TE.png

 

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 🙂

Anonymous
Not applicable
Author

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.

0683p000009M3TJ.png

0683p000009M3TO.png

 

Anonymous
Not applicable
Author

your code works very well thank you.
I want to read line by line of a column and returned the value of the line n ° 5 for example

do you have an idea to do this please
Anonymous
Not applicable
Author

@didi 

 

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 🙂