Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

agni_gold
Valued Contributor II

EXTRACT GOOGLE lat and lng using QV script

I an trying to extract google lat and lng using following script , but it gives error : [result/geometry/location/lng]  not found

address:

LOAD A as Address

FROM

(ooxml, no labels, table is Sheet1);

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

for i=0 to $(noRows)

let a=peek('Address',$(i),'address');

Data:

LOAD

'$(a)' as Address,

[result/geometry/location/lng] AS longitude,

[result/geometry/location/lat] AS latitude

FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(a)&sensor=false];

drop Table address;

Please help

2 Replies
MVP
MVP

Re: EXTRACT GOOGLE lat and lng using QV script

Hi.

I'm using geocoding.qvw.

I have a different "from".

FROM [http://maps.google.com/maps/api/geocode/xml?sensor=false&ie=utf8&region=$(vTLD)&address=$(vAddress)] (XmlSimple, Table is [GeocodeResponse])

you need to set up some variable before  (inside  for...next)

Alessandro Furtado

MVP & Luminary
MVP & Luminary

Re: EXTRACT GOOGLE lat and lng using QV script

Hi,

Check this script, I am getting the values.  May be check whether the proxy is blocking any request.  In some companies they will block, you check in machine which has full internet access without any blocking.

GeocodeResponse:

LOAD status,   

    [result/geometry/location/lat] as [location/lat],

    [result/geometry/location/lng] as [location/lng],

    %Key_GeocodeResponse_62C7A0A69859D655    // Key for this table: GeocodeResponse

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

Regards,

Jagan.