Just Qlik it: Simple Maps

Today’s ‘Just Qlik it’ focuses on using simple maps in QlikView. I’ve been playing with this kind of objects in Qlik Sense recently and I thought it would be good to remember how we created these cartographic visualizations in the old days.

As the ancient masters taught us, before Qlik Sense, GeoQlik and custom extensions, there were scatter charts…

10.9

Tutorial

An easy way to create maps in your applications is to exploit the Google API. As always, the reference material with all the examples is here.

1.- Paste the ‘Google Maps’ tab in your script

2.- Be sure to create the fields for Longitude and Latitude in your data model. If you don’t have this information, you can manually find it online (hahaha) or you can search it within your QV script with a routine like this one:

10.5

You can use data that is already in your catalogues like the city or zip code to ask Google for a XML file with the fields you need. In this example, I am only using the zip code and the string ‘MX’ (I am from Mexico), but you can concatenate multiple fields to be more specific.

Just a warning, Google has a limit of free daily queries, so you might want to create a QVD that stores this information and only ask for the new zip codes with an incremental load.

3.- Select which type of map you want and customize it.

Bubble Size Map

10.1

Dimension: Select the appropriate field (country, city, store, etc.)

Expression 1 (Longitude): It’s not necessary to edit the expression itself. However, the color is defined in the ‘Background Color’ option.

10.7

Expression 2 (Latitude): No customization needed.

Expression 3: Add your expression here.

Expression 4: If you want, you can create a customized pop-up with more information.

10.6

 

Color Intensity Map

10.2

The trick behind this map is to change the bubble size (Expression 3) to 1 and set the color (Expression 1 > Background color) with a Color Mix function:

10.10

 

Bubble size + Color Map

10.3

Assign an interesting conditional function to the color. Seems pretty simple, but you can create awesome maps if you represent one metric with the bubble size and another one with the color intensity. For example, a big bubble could represent a strong territory (high sales), but an intense bubble could be considered an intelligent territory (high margin). The interaction between these two perspectives in your brain can bring interesting results.


Update: Recently, Google changed the URL of the images we use as backgrounds for this kind of maps, so you’ll have to make some minor adjustments in your apps.

https://community.qlik.com/message/952604#952604


 

Heat Map

10.12

Forget about bubbles and let Google do the work. You can create a text object (Representation: Image) with this formula:

10.11

The only tricky thing is that you need an ISO 3166 code in your data model, but you can get it for Wikipedia.

 

Of course, there are many other interesting options out there, but it is good to return to the classics every now and then.

Any suggestions or ideas? Leave a comment in the section below!

7 thoughts on “Just Qlik it: Simple Maps

  1. Thanks for sharing. I read your warning about limited fee usage. I actually spoke to Google about this on the behalf of a client. If you are using Google maps in a non system you are not eligible to use the free licenseat allpublic . You will have to pay for a license to use it.

    In the case of QlikView it is only a public accessible extranet server that could use Google maps without purchasing a license.

    NB. We are allowed to use the free license for development and demo purpose.

  2. “The only tricky thing is that you need an ISO 3166 code in your data model”

    I can get a list of the ISO 3166-2 codes from Wikipedia, but how do they relate to your impressive heat map example?

    1. To put it in QlikView terms, these codes would work as dimensions for a chart. Therefore, you can add them to your data model in your customer catalogue just as the state, zip code or any other field. Actually, in the example provided the only fields are State, Region and Code, and they relate to the Sales table via State. For example, one of the registers in the Dimension table is: Alabama | Southeast | US-AL. And its corresponding line in the Fact table is: Alabama | 2,500.

Leave a comment