Hello there, Can someone help me with the following. I have the following two datasets. Ned to join Dataset_1 with Dataset_2 on ZIP and City. Need to match only once based on the shortest Distance_mile. If match, then create a dataset (e.g. matched), If do not match, then create a dataset (e.g. Notmatched). Again, if Clientno match twice, I need to pick only the one with the shortest distance. Sorry, the Dataset_2 is huge, so only sample fake data here
Dataset_1
Dataset_2
ZIP
ClientNo
City
ZIP
SEQ
Distance_Miles
City
14215
A52498
Buffalo
14215
1
1.2
Sloan
14213
A09533
Buffalo
14215
2
2.0
Amherst
14207
A63397
Buffalo
14215
3
2.5
Buffalo
14216
A77384
Buffalo
14215
4
6.0
Seneca
14220
A73552
Buffalo
14215
5
10.0
Kenmore
14214
A31165
Buffalo
14213
1
0.4
Buffalo
14211
A06391
Bristol
14213
2
1.5
Kenmore
14206
A71649
Bristol
14213
3
8.0
Blasdell
14222
A66949
Bristol
14213
4
12.0
Buffalo
14210
A43865
Bristol
14213
5
15.0
Blasdell
14201
A95572
Cedar Grove
14201
1
1.1
Cedar Grove
14208
A06957
Cedar Grove
14201
2
5.3
Sloan
14204
A91374
Cedar Grove
14201
3
9.3
Amherst
14209
A58062
Cedar Grove
14201
4
15.5
Buffalo
14212
A54498
Cedar Grove
14201
5
30.1
Mo Town
14216
1
2.0
Cheektowaga
14216
2
7.2
Great Hill
14216
3
8.8
Buffalo
14216
4
14.2
Fort Erie
14216
5
21.6
Ajax
14220
1
3.0
Sloan
14220
2
4.6
Amherst
14220
3
8.0
Cheektowaga
14220
4
14.9
Great Hill
14220
5
26.2
Milton
... View more