Enhance Your Qlikview Maps with a Few Simple Tweaks (& fix them if they’ve broken).
Firstly apologise for the amount of time its taken to update the blog, I can’t believe it’s been nearly 3mths since my last post. The reasons are many but chief amongst them is the fact I’ve been thinking a bit deeper about Qlikview and BI in general and have been creating some innovations in those areas that I may be able to divulge shortly.
Anyway onto this post. Earlier this week many of you will have noticed that your Qlikview GoogleMaps integrations stopped working, the reason being that Google stopped supporting versions 2 of their ‘Static Map API’ which Qlikview utilised and moved wholly to v3. Firstly here’s a straight like for like dynamic URL replacement provided by Alexander Karlsson (@MindSpank): http://pastebin.com/sDXzd1Yg simply swapping your old v2 for his URL should get you back to where you were.
As everyone now needs to start using v3 it seems like an apt time to share a v3 mapping innovation I developed a few weeks ago.
Currently I’m working in the Insurance industry and one of their primary concerns is the risk of flooding, they really like to see their insurance exposures plotted on a map therefore allowing them to see where they may be over exposed and the standard setup allows this to a degree but doesn’t work as well as it might. This led me to trawl through the GoogleMaps API documentation (https://developers.google.com/maps/documentation/staticmaps/) to find out what the limits of it were and it turns out with v3 the limits are beyond what standard Qlikview GoogleMaps can achieve.
After reading the documentation it became clear that with the right URL many of the map elements can be tailored to suits ones needs, for instance in my case looking at flood risk I can remove all the labels, show terrain and crucially highlight all the bodies of water in a colour of my choosing and the result’s shown below:
Its not showing anything that the standard setup doesn’t but it shows the details that my client is most interested in an enhanced manner and really helps the high risk exposures to jump out. The URL I’m using is: =’http://maps.googleapis.com/maps/api/staticmap?center=’&Replace(var_mid_lat,’,’,’.’)&’,’&Replace(var_mid_long,’,’,’.’)&’&zoom=$(var_zoom)’&’
&style=element:labels|visibility:off&format=png&sensor=false&size=400×400&Scale=2&maptype=terrain&style=feature:water|element:geometry.fill|visibility:on|invert_lightness:true|color:0x0000ff Now the eagle eyed amongst you will notice I’m using a higher fidelity scatter map chart than normal, this is because I’m using a custom Long Lat file that runs from the highest PostCode Area (AB) down to the full Post Code (AB1 2CD) via District and Sector with Long & Lats for each giving the higher fidelity that my clients need. Incidentally the standard ‘postcodes.xls’ file that many people in the UK seem to be using is a bit misleading; firstly it only covers the PostCode Districts (AB1) so everything ends up very aggregated on the map and also several Districts share the same Long Lat values (7 in central Birmingham for instance) this can therefore lead to misleading charts.
What else can be done with the new v3 of the maps API? Well I strongly recommend you go and read the documentation and experiment yourself but to guide you there’s a brilliant ‘wizard’ to get you started: http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html tailor the map as you chose then copy and paste the URL the integrate the variables in Qlikview.
Basically you can colour elements how you choose, turn off labels and even add markers as well as the v2 ability to switch the map type which all told creates a fantastically flexible tool.
Here’s a URL I knocked together to show Lund in Sweden, with the roads highlighted in Qlikview Green and a maker showing where (I think) The Qliktech offices are – it’s an ugly map but it shows the flexibility! http://maps.googleapis.com/maps/api/staticmap?center=55.715892,13.220093&zoom=16&format=png&sensor=false&size=640×480&style=element:labels|visibility:off&maptype=hybrid&style=feature:road|element:geometry|visibility:on|color:0x00ff00&markers=color:0x00ff00|label:Q|55.716572,13.221248
So get thinking: what do your clients need to be seeing on their maps? Is the standard RoadMap really the best solution?
Hopefully when Qlikview v12 comes along this solution won’t be needed as Qliktech will have created a dedicated mapping object that takes full advantage of version 3’s functionality.
As always I hope this has been of use.
Hopefully it won’t be as long until the next post.
All the best,