1 Reply Latest reply on Jun 7, 2016 10:55 AM by Steve Burger

# Highlighting that seemed simple, but this is a rabbit hole.... At least for me

Hello,

I have a table that looks like this (and so on):

OfficeLatLongClosest1Closest2Closest3Closest4
Office1Lat1Long1Office2Office3Office4Office5
Office2Lat2Long2Office1Office7Office8Office9
Office3Lat3Long3Office10Office2Office1Office7
Office4Lat4Long4etcetcetcetc
Office5Lat5Long5etcetcetcetc
Office6Lat6Long6etcetcetcetc
Office7Lat7Long7etcetcetcetc

I can map all the dots since i have latitude and longitude, and what I want, is to highlight the 4 closest offices when i click on one of them.

In Tableau, I can only highlight members of a level within a field. For instance, I can tell the map to highlight all common locations shared within a state, or a city, or a code...

In this case, I though of creating groups so that I can tell Tableau who to highlight based on this "group" column, but it would not work because even though office x is closest to office y, maybe office y is not closest to office x.. And if I duplicate some of the rows (offices) where this happens (some offices will have more than one group) then when I click on it it's not going to know which group it belongs to and will end up highlighting the wrong 4 offices.

Any ideas?

I know filters are more versatile, so if it can be done through filters, that is fine... but preferably I would highlight.

Thanks so much for your help!!!

• ###### 1. Re: Highlighting that seemed simple, but this is a rabbit hole.... At least for me

Daniel,

It might be more do-able to consider a calculation based on Lat & Long to determine closest 1, closest 2, rather than the data itself.

In other words, use Lat Long for Office 2 in relation to Office 1 to confirm that mathematically it is in-fact the closest.  You need the Spherical Law of Cosines.

Luckily, we have a KB for this.  Now this example calculates from a point (Lat Long) to the nearest zip code. But you'd simply need to modify to measure from Point A (Office 1 Lat Long) to Point B (office 2), Point C, (office 3), and so on..

Finding Zip Codes Within N Miles of a Location | Tableau Software

If you've found this post helpful and/or it's answered your question, please mark it as so, so that others can find it quickly.

Best Regards,

Steve Burger