Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 :
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 .
You probably need to follow the long steps below :
(Following 1)
(Following 2)