2 Replies Latest reply on Sep 24, 2018 11:59 AM by Julianne Hergenroder

    Calculating the distance between two lats/longs

    Julianne Hergenroder

      Hello,

       

      I have joined two tables in tableau, both with lats/longs. I am trying to measure the distance between the two separate lats/longs for each table (patient to medical clinic). I looked at previous forum posts and tried using the query, which I cannot get to work. When I use the Custom SQL and paste in:

      SELECT

       

        [Sheet1$].[Location] AS [Location],

        [Sheet1$].[Long] AS [Long],

        [Sheet1$].[Lat] AS [Lat],

       

        [Sheet1b$].[Location] AS [Location2],

        [Sheet1b$].[Long] AS [Long2],

        [Sheet1b$].[Lat] AS [Lat2]

       

      FROM [Sheet1$] INNER JOIN [Sheet1$] [Sheet1b$]

      ON ([Sheet1$].[Location] <> [Sheet1b$].[Location])

       

      I get an error. I have tried editing this to fit my sheets, columns and I always get the message: (ERROR: syntax error at or near "["; Error while executing the query).

      The link to the example online downloads blank for me from the forum; does anyone have any recommendations?

       

      Thank you,

      Juli