Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to find a way to match data based on a partial match. I have two tables (table A and table B). Table A contains a specific column of data and Table B contains a column of data with a guid that contains the specific piece of data from Table A. The problem is the piece of data I am trying to match appears at different locations in each guid so I can not specify where to start looking in the guid in my load statement. Also the data in the guid might have an - or a letter attached.
Table A | Table B |
654011 | 654011-4-654011-4-2DTSA81181.txt |
704476 | -704476-704476-1DTSA10620.txt |
719585 | RCR-2GTSA11344-RL719585A-2GTSA11344.txt |
Hi Melvin,
Use wildmatch () function.
What you want to do after finding the Table A field in Table B ?
The data in Table A corresponds with a persons name, so if I can match the data I can get the list of people.
try this
TableA:
load * inline [
f1
654011
704476
719585
];
join (TableA)
load * inline [
f2
654011-4-654011-4-2DTSA81181.txt
-704476-704476-1DTSA10620.txt
RCR-2GTSA11344-RL719585A-2GTSA11344.txt
];
Table:
NoConcatenate
load *
//WildMatch(f2, '*' & f1 & '*') as match
Resident TableA
where WildMatch(f2, '*' & f1 & '*');
DROP Table TableA;
T1:
Load * Inline
[
Short
654011
704476
719585
];
Join
T2:
Load * Inline
[
Long
654011-4-654011-4-2DTSA81181.txt
-704476-704476-1DTSA10620.txt
RCR-2GTSA11344-RL719585A-2GTSA11344.txt
];
NoConcatenate
Final:
Load Short, Long Resident T1
Where Index(Long, Short)>0;
Drop Table T1;