Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kakooo16
Creator
Creator

How to get the difference between two columns

I Have two excel sheets that i want to compare using talend job 

First excel named Compare_Me_1 

| PN | STT |Designation |

| -------- | -------------- |-------------- |

| AY73101000| 20|RC0402FR-0743K2L  |

| AY73101000| 22|RK73H1ETTP4322F  |

| AY73101000| 22|ERJ-2RKF4322X  |

| Ac2566| 70|CRCW040243K2FKED  |

Second excel named Compare_Me_2

| PN | STT |Designation |

| -------- | -------------- |-------------- |

| AY73101000| 20|RC0402FR-0743K2L  |

| AY73101000| 22|RK73H1ETTP4322F  |

| AY73101000| 21|ERJ-2RKF4322X  |

| Ac2566| 70|CRCW040243K2FKED  |

what i want to achieve is this output 

| PN1 |STT1 |STT2 |STT_OK_Ko | Designation1 |Designation2 |Designation_Ok_Ko |

| -------- | -------------- |-------------- |-------------- |-------- | -------------- |-------------- |-------------- |

| AY73101000| 20  |20  |ok| RC0402FR-0743K2L|RC0402FR-0743K2L  |ok  |

| AY73101000| 22  |22  |ok| RK73H1ETTP4322F|RK73H1ETTP4322F|ok |

| AY73101000|22  | 21  |ko| ERJ-2RKF4322X|ERJ-2RKF4322X|ok  |

| Ac2566| 70  | 70   |ok| CRCW040243K2FKED  |CRCW040243K2FKED  |ok  |

So to achieve this i developed a talend job that looks like below : 

0695b00000Hvt5mAAB.png

In My tMap i linked PN with a **leftouterjoin** and **All Matches** correpdance . 

And to get for example STT_Ok_KO i used bellow code to compare my two input : 

  (!Relational.ISNULL(row14.STT) && !Relational.ISNULL(row13.STT) &&

   row14.STT.equals(row13.STT) ) ||

  (Relational.ISNULL(row14.STT) && Relational.ISNULL(row13.STT))

  ?"ok":"ko" 

Is this the correct way to achieve my ouput ? If not , recommand me to use an other method

 

Any suggest is welcome . 

Labels (2)
3 Replies
Mahamoutou
Contributor III
Contributor III

You probably need to follow the long steps below :

 

0695b00000Ic6wsAAB.png0695b00000Ic6xbAAB.png0695b00000Ic6xvAAB.png0695b00000Ic6xwAAB.png0695b00000Ic6z8AAB.png0695b00000Ic6zXAAR.png0695b00000Ic6zmAAB.png0695b00000Ic6opAAB.png0695b00000Ic70BAAR.png0695b00000Ic70aAAB.png 

 

 

 

 

 

 

Mahamoutou
Contributor III
Contributor III

(Following 1)

0695b00000Ic71sAAB.png0695b00000Ic727AAB.png0695b00000Ic72HAAR.png0695b00000Ic730AAB.png0695b00000Ic735AAB.png0695b00000Ic73KAAR.png0695b00000Ic73eAAB.png0695b00000Ic73tAAB.png0695b00000Ic74DAAR.png0695b00000Ic74NAAR.png

Mahamoutou
Contributor III
Contributor III

(Following 2)

0695b00000Ic75aAAB.png0695b00000Ic75uAAB.png