1 Reply Latest reply: Feb 14, 2017 10:43 AM by Michael Tarallo RSS

    Retrieve Latitude and Longitude on Qlik Sense

    Davide Zamunaro

      Hi  , I have a script (below)  for Qlik View to  retrieve Longitude and Latitude  using Goggle Maps API (without using QV connector)

       

      Anyone can help me to do the same thing on Qlik Sense ( i have already configured REST Connector on Sense ) but I don 't

      know how to use it on Load statement

       

      Thanks

       

      Script for Qlik View:

       

      Locali:

      LOAD LOCALE,

           INDIRIZZO,

           CITY,

           CAP,

           PROVINCIA,

           WEB,

           MAIL,

           FB,

           OTHERS,

           NOTES

      FROM

      [D:\Locali\LIVE.xlsx]

      (ooxml, embedded labels, table is Foglio1);

       

      let noRows = NoOfRows('Locali')-1;

       

      for i=0 to $(noRows)

        let a = peek('LOCALE',$(i),'Locali');

          let b = peek('CITY',$(i),'Locali');

          let c = peek('CAP',$(i),'Locali');

            

      GeocodeResponse:

        LOAD

        status,

        '$(a)' as LOCALE,

        '$(b)' as CITY,

        '$(c)' as CAP,

        ([result/geometry/location/lat]) as latitude,

          ([result/geometry/location/lng]) as longitude

        FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(b)&sensor=false] (XmlSimple, Table is [GeocodeResponse]);

      next i;