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: 
remo0017
Contributor II
Contributor II

Matching multiple fields in one table with other table

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”

2 Replies
JGMDataAnalysis
Creator III
Creator III

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;
Brett_Bleess
Former Employee
Former Employee

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

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.