Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a situation where I need to compare multiple fields with one field and than have it say as matched or not-matched if it either matches or not matches
Details:
Table1
Field1 - 10.1.1.100
Field 2- 10.2.2.101
Field3 - 10.3.3.103
Table 2: FieldA has data separated by Comma (,)
FiledA: 10.1.1.100, 10.1.1.101, 10.1.1.103
So, when I compare all the above four fields from Table1 with FieldA in Table 2, since there is a match (10.1.1.100) this has to be labelled as “Matched” if there is no match it should display as “No Match”
Something like this?
Table1:
NOCONCATENATE
LOAD * INLINE [
Field1, Field2, Field3
10.1.1.100, 10.2.2.101, 10.3.3.103
];
Table2:
NOCONCATENATE
LOAD Trim(SubField(FieldA, ',')), 'Match'
;
LOAD * INLINE "
FieldA
10.1.1.100, 10.1.1.101, 10.1.1.103
" (delimiter is ';');
MapFieldValues2Match: MAPPING LOAD * RESIDENT Table2;
Final:
NOCONCATENATE
LOAD *,
ApplyMap('MapFieldValues2Match', Field1,
ApplyMap('MapFieldValues2Match', Field2,
ApplyMap('MapFieldValues2Match', Field3, 'No Match'))) AS Test
RESIDENT Table1;
DROP TABLES Table1, Table2;
Remo, did Javier's post help you get things working as you wanted? If so, do not forget to return to the thread and use the Accept as Solution button on the post to give him credit for the help and confirm to others that it did solve your problem. If you still need further help, leave an update on things.
Regards,
Brett