Hi everyone,
I have two datasets I want to merge. The master dataset has 2 variables, A and B, that are candidates to merge with the using dataset's C. A and B do not uniquely identify observations, but C does. A and C are never missing, but B sometimes is. Ideally, I want to merge firstly using A, and then when _merge = 2, try to use B to merge those observations in.
If this all seems a bit bizarre, in my datasets A, B, and C are all company names following slightly different formats, and while I am most confident A is best at matching with C, A is current name rather than historical unlike B and C so only B can provide a match for some older observations.
I have two datasets I want to merge. The master dataset has 2 variables, A and B, that are candidates to merge with the using dataset's C. A and B do not uniquely identify observations, but C does. A and C are never missing, but B sometimes is. Ideally, I want to merge firstly using A, and then when _merge = 2, try to use B to merge those observations in.
If this all seems a bit bizarre, in my datasets A, B, and C are all company names following slightly different formats, and while I am most confident A is best at matching with C, A is current name rather than historical unlike B and C so only B can provide a match for some older observations.
Comment