Tableau: Distance formula

Calculate distance between 2 geographical points (great-circle distance):

[VAR] * ACOS
(
SIN( RADIANS([Origin-Latitude]) ) * SIN( RADIANS([Destination-Latitude]) ) +
COS( RADIANS([Origin-Latitude]) ) * COS( RADIANS([Destination-Latitude]) ) *
COS( RADIANS([Destination-Longitude]) – RADIANS([Origin-Longitude]) )
)

[VAR]= 3959 for miles
[VAR]= 6371 for kilometers

Recent Related Posts
Femke Kooij is a dashboard and report designer, developer and educator specializing in SAP | BusinessObjects Dashboards (better known as Xcelsius) and Crystal Reports. She has also a lot of experience with other SAP | BusinessObjects toolings like, Web Intelligence (WebI), Information Design Tool (Universe Designer), BusinessObjects Data Services (BODS) and the overall server platform BusinessObjects Enterprise (Launchpad, CMC). She spends a lot of her time thinking about and sharing her knowledge of Xcelsius to others through her own blog. Lately she is exploring other visualization tools like Qlikview and Tableau. On the later she is also posting some experiences. Currently she is in the employment of Cognizant Technology Solutions. Her blog only contains her personal views, thoughts and opinions. It is not endorsed by Cognizant Technology Solutions nor does it constitute any official communication of Cognizant Technology Solutions.

This entry was posted in Tableau and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>