I'm trying to create google map in QlikView
for dashboard creation. The version of QlikView I use is 12.10. I use the following code for main:
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
CustomerTable:
LOAD Quantity, Customer, City
FROM [C:\Users\540195\Downloads\Customer_info.xls] (biff, embedded labels, table is Sheet1$);
let noRows = NoOfRows('CustomerTable')-1;
for i=0 to $(noRows)
let a=peek('Customer',$(i),'CustomerTable');
let b=peek('City',$(i),'CustomerTable');
let c=peek('Quantity',$(i),'CustomerTable');
GeocodeResponse:
LOAD
status,
'$(a)' as CustomerName,
'$(b)' as CustomerCity,
'$(c)' as CustomerQuantity,
([result/geometry/location/lat]) as latitude,
([result/geometry/location/lng]) as longitude
FROM [http://maps.google.com/maps/api/geocode/xml?address=$(b)&sensor=false](XmlSimple, Table is [GeocodeResponse]);
next i;
and the following code for a new tab named Google Map:
// Google Maps Key
gmap_key =“;
max_zoom_level = 14;
Def_zoom_level=7;
Def_map_size=400;
// Variables required for calculating map
// No need to change these
var_pi180= '=pi()/180';
var_lat_offset= '0';
var_mc2= '=256*pow(2,$(var_zoom))';
var_mc1= '=256*pow(2,($(var_zoom)-1))';
var_mid_lat= '=median(latitude)';
var_mid_long= '=median(longitude)';
var_zoom= '=if(max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1-(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)';
var_maptype= '=if(isnull(only(maptype)),fieldvalue('&chr(39)&'maptype'&chr(39)&',4 ),maptype)';
SET HidePrefix='_' ;
// Field required for calcualting best zoom level
_zoom_level:
Load RecNo( ) as _zoom_level Autogenerate(max_zoom_level);
maptype:
LOAD * INLINE [
Maptype
roadmap
mobile
satellite
terrain
hybrid
];
This code was used in previous versions of QlikView and got the results as:
But when I use it for my version. I'm getting the result as:
Do anyone has any idea?