0

I have two file of the same format and columns and i am comparing them by passing them in a joiner and setting join key to all the fields.

file a:
ID    DESC    CODE   COMMENT   VALUE
1    AFAF     34      GDG        34
2    DGF      45      DGDF       45

file b:
ID    DESC    CODE   COMMENT   VALUE
1    AFAF     34      XXX        34
2    XXX      45      DGDF       45

IN jOINER, I am setting join key as {ID},{DESC},{CODE},{COMMENT},{VALUE} Using the example file both records will go into Unused port.

My question here is, is it possible to get to know due to which field the record is rejected. As in is it possible to get the below output

1    AFAF     34      XXX        34  Comment mismatch
2    XXX      45      DGDF       45  DESC mismatch 

Graph used:

Input file---->Reformat-------
                           |----Joiner----Output
Input file 2---->Reformat-----        --Unused

strong text

Ankit Srivastava
  • 185
  • 3
  • 13

2 Answers2

0

Possible but you have to fix/decide your key. Seems like you want to match these files on id as the key or add any if you want to have more keys. By having that as your join key then write your transform function something like this.

out.comments::if((string_upcase(string_lrtrim(in0.DESC))) != (string_upcase(string_lrtrim(in1.DESC)))) "desc mismatch" else if(do the same on other columns);

By doing this you will be able to get records matching on the keys provided with comments on which key doesn't match.

Vignesh I
  • 2,211
  • 2
  • 20
  • 40
0

if you want to identify the records or the field due to which there is a difference then you can use dynamic compare records as well.