Search code examples
excellocationtableau-apidistancealteryx

Method/tool for determining the distance between locations


I work for a healthcare company and have information on patient's location (address, city, state, zip). I am trying to determine what percentage of patients live closest to 5 specific locations. The answer I'm looking for would be something like "25% of patients live closest to location #1, 10% closest to #2, etc." I'm hoping someone can point me in the right direction (app to use/approach to take).

The data is stored in a Tableau extract but work with the data in Excel.

Applications I have at my disposal in order of comfort are: - Tableau - Excel - Alteryx - Python - R


Solution

  • There are several ways you can do this in Alteryx by using their Spatial tools. Some general methods you could consider are calculating the distance each "address" is to each "location" using the distance tool, rank each "address"' distance from each "location", then using the summarize tool you can group them by rank and then "location" and see various statistics.

    From that data set you can visualize this in Tableau in multiple ways, get creative!

    You could calculate these distances in Excel with a lot more hassle. If you have latitudes and longitudes, the formula for distance between two points is:

    =ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2))) *6371