Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Nearest neighbor question

Yuri24
8 - Asteroid

Hello,

 

I am trying to join based on  zip in one dataset to zip in another. All good with inner join where zips match. However for the left portion where the zips not in right data set is there a way to get the nearest neighbor from the right?  For instance left dataset has 94110 which is not in right dataset but it has 94111, in this case both are San Francisco, CA so is there a way to get something like 94111 returned as nearest neighboring zip? My right dataset has only one corresponding nearest neighbor so in this example it wont have 94109.

 

TIA

2 REPLIES 2
DataNath
17 - Castor

Hey @Yuri24, the way I'd go about this is somehow linking the latitude and longitudes to each ZIP code (using a lookup table or calling an API etc). Once you have this, you can create spatial points in Alteryx and use the Find Nearest tool to do exactly what you're looking for.

 

https://help.alteryx.com/20223/designer/find-nearest-tool

PhilipL
Alteryx
Alteryx

@Yuri24 

 

Hi Yuri,

 

You should consider using Alteryx Location Insights. It includes spatial/location info for Zip Codes, including dedicated point Zip Codes for businesses, schools, gov't buildings, etc., and is perfect for a "real" nearest neighbor analysis.

 

It can also be used to improve the accuracy of your analytics to the address level.

 

Cheers!

Phil

Labels