2 Replies Latest reply on Oct 6, 2017 2:17 PM by Siddharth Patil

    Calculate distance between two zip codes

    nick.cook.0

      I am trying to calculate the distance between two zip codes. I have a dataset that contains two zip codes (customer zip & retail zip) as well as one dimension - sales (units). I would like to calculate the distance between store and customer to use as a filter - and to know as an average.

       

      I've found this code for calculating distance

      3959 * ACOS

      (

      SIN(RADIANS([Lat])) * SIN(RADIANS([Lat2])) +

      COS(RADIANS([Lat])) * COS(RADIANS([Lat2])) * COS(RADIANS([Long2]) - RADIANS([Long]))

      )

       

      But cannot figure out how to identify the latitude/longitude of a specific zip.