In the this example, I am trying to see whether values in column A in table 1 appear within the values in column A table 2.
If it does I want to add column B in table 1, which returns the value of column B in table 2 where the matches occur.
Desired output:
Table 1
| A | B |
|---|---|
| dhjasd sd Y02sd | 105 |
| Y02 dsd | 105 |
| sds Y0545 dsas dds | 106 |
| Y093 sad | |
| sd Y304sd |
Reference Table:
Table 2
| A | B |
|---|---|
| Y01 | 102 |
| Y06 | 103 |
| Y02 | 105 |
| Y08 | 110 |
| Y0545 | 106 |
Can I please get any advice on how I should approach this? Thank you for your help!
Using
dplyryou can do the following: