Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have the following code but it doesn't seem to work and gives an error: "Download Failed"
[Location]:
LOAD loc_id,
area,
city,
country
FROM
[..\POC Data & Schema\Citi_2nd_POC_Data_19_Jan\location_dim.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
let noRows = NoOfRows('Location')-1;
for i = 0 to $(noRows)
let a = peek('loc_id',$(i),'Location');
let b = peek('area',$(i),'Location');
let c = peek('city',$(i),'Location');
let d = peek('country',$(i),'Location');
Data:
LOAD
'$(a)' as location_id,
'$(b)' as locArea,
'$(c)' as locCity,
'$(d)' as locCountry,
subfield([Response/Placemark/Point/coordinates], ',' ,1) AS longitude,
subfield([Response/Placemark/Point/coordinates], ',' ,2) AS latitude
FROM [http://maps.google.com/maps/geo?q=$(c)&output=xml&oe=utf8&sensor=false&key=XXYYZZ] (XmlSimple, Table is [kml]);
next
Can anybody help me troubleshoot the error?
Hi Vinayak,
Try below code. It works for me.
Data:
LOAD
'$(a)' as location_id,
'$(b)' as locArea,
'$(c)' as locCity,
'$(d)' as locCountry,
([result/geometry/location/lat]) as latitude,
([result/geometry/location/lng]) as longitude
FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(c)&sensor=false] (XmlSimple, Table is [GeocodeResponse]);
next i;