Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 


#Product
#Analytics
#CognosAnalytics
#Analyticstools
#TechXchange Partner
#TechXchange Session
#TechXchange Presenter
#AI
 View Only
  • 1.  Calculating distance between 2 Lat Long coordinates

    Posted 05/25/21 10:16 PM
    Edited by System Admin 01/20/23 04:16 PM
    Hi,

    I am sure this has been discussed previously, but I cannot seem to find anything.

    We have 11.1.7 installed, I am wondering is there is a way to calculate the distance (as the crow flies) between 2 GPS locations within Cognos ?

    Thanks in advance,


    ------------------------------
    Chris Adams
    ------------------------------
    #CognosAnalyticswithWatson


  • 2.  RE: Calculating distance between 2 Lat Long coordinates

    Posted 05/27/21 10:21 AM


  • 3.  RE: Calculating distance between 2 Lat Long coordinates

    Posted 05/28/21 03:18 PM

    Several databases will offer you some GIS functions, hence look at those.

    If you want to compute using SQL expressions, if your system has the trig functions.

    The distance between lat and long points can be derived using the Haversine formula

    DEGREES(ACOS(COS(RADIANS(lat1)) * COS(RADIANS(lat2)) * COS(RADIANS(long1) - RADIANS(long2)) + SIN(RADIANS(lat1)) * SIN(RADIANS(lat2))))

    Multiplying value by constant to change units

    • Kilometers = 111.045
    • Meters = 111045.0
    • Miles = 69.0




    ------------------------------
    NIGEL CAMPBELL
    ------------------------------