Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!

Qlik Sense UK Maps

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
lorenzoconforti
Specialist II
Specialist II

Qlik Sense UK Maps

Last Update:

Oct 11, 2019 1:43:41 PM

Updated By:

lorenzoconforti

Created date:

Oct 11, 2019 1:43:41 PM

Attachments
The purpose of this app is to show an example of how to integrate and display different layers of geographical boundaries available for the UK.
The data displayed has been randomly generated just to show the potentials of this implementation.
 
 
There are multiple geographical levels in the UK and KML maps are freely available for download; a drill-down path can be established between the different layers:
European Electoral Regions (EERCode) > Local authority district (DistrictCode) > Middle layer super output areas (MSOACode) > Lower layer super output areas (LSOACode) > Output areas (OACode)
 
The link between the different layers is provided by the postcode database that lists all the available postcodes in the UK and their relations to all the relevant layers; multiple areas can be selected at the same time.
 
This applications has two sets of inputs:
 
Postcode file - ONS Postcode Directory (ONSPD) [https://geoportal.statistics.gov.uk/datasets/ons-postcode-directory-august-2019]: download the latest available version and rename it to "postcodes.csv"
 
Boundaries KML files:
- European Electoral Regions (EERCode) [https://geoportal.statistics.gov.uk/datasets/european-electoral-regions-december-2018-boundaries-uk-...]:rename it to "EuropeanElectoralRegions.kml"
- Local authority district (DistrictCode) [https://geoportal.statistics.gov.uk/datasets/local-authority-districts-april-2019-boundaries-uk-buc]: rename it to "Districts.kml"
- Middle layer super output areas (MSOACode) [https://geoportal.statistics.gov.uk/datasets/middle-layer-super-output-areas-december-2011-boundarie...]: rename it to "MSOA.kml"
- Lower layer super output areas (LSOACode) [https://geoportal.statistics.gov.uk/datasets/lower-layer-super-output-areas-december-2011-super-gene...]: rename it to "LSOA.kml"
 
The KML files are read during data load as XML, and reformatted to then be read by the maps area layer in the Qlik Sense app. They can't be read straight as KML files as the name of each area needs to be extracted from a property field in the source files. As the boundary maps are updated, from time to time the name of these key fields changes. I've defined these key fields in 5 separate variables in the "Main" tab in the data load editor; just ensure that these names have the correct correspondence in KML files if you decide to download updated maps in the future.
 
The drill down feature relies on dimensions to be calculated by an expression. I've noticed that Qlik Sense tends to modify this expression if I open and close the editor. This is how it should look like in the "Map object > Area layer > Data >Dimensions > Area > Field": '$(dimensionUse2)' [note that single quotes are required]. If you open the expression editor Qlik Sense will add an extra "=" sign and extra square brackets which will break the expression; just remove the "=" sign and the square brackets without opening the expression editor.
 
Postcode file and maps are all loaded in memory; to limit the size of the database I've loaded low resolution maps; you can find higher resolution maps from the links above. For the type of analysis I work on (statistical analysis on house pricing, crime and population with R) I don't see the need for the higher resolution maps.
 
I've also included a "Zoom Out" button which allows to drill up to next higher map level; ensure you have the Qlik dashboard bundle installed. I've used Qlik Sense September 2019 version to develop this app.
 
You can also establish a different path for drill down to limit the number of layers or to have a different starting layer; just have a look how dimensions are dynamically defined in the variables section.
 
I've included all the files in the zip folder; ensure the Data connection in the data load editor points to the correct folder on your machine.
 
I hope this is helpful; please get in touch if you have any questions.
 
Lorenzo
 
 
Screenshots
Starting map - EER:
clipboard_image_0.png

 

Alternative starting map - Districts:

 

clipboard_image_9.png

 

Multiple selection of areas (available at all levels) - EER level:

clipboard_image_3.png

 

District level:

clipboard_image_4.png

 

MSOA level:

clipboard_image_5.png
 
 
LSOA level:
clipboard_image_7.png

 

OA level:

clipboard_image_8.png

 

 

Labels (4)
Comments
JQ123
Contributor II
Contributor II

Thank you for this excellent piece of work, it's been really helpful!

I had to use different KLM files to allow me to have the drill down working in Scotland, and even now I haven't got it working all the way to postcode level north of the border. 

Do you know how I would be able to implement a filter that displayed the names of the district so that when you selected a district from the filter it moved the map (view) to the district layer? There doesn't seem to be a way (that I know) to have one filter selection cause other values of a different filter to be selected. 

From looking at the variable that drives the map, selecting a given district(s) (in a filter) would have to cause all available EER's to be selected. 

It would be good to have this ability for all layers. So from the top layer of the map (EER) if a user selected a postcode in a filter the map would zoom down to the postcode layer. 

Any help would be much appreciated. 

Thanks, Jamie.

0 Likes
lorenzoconforti
Specialist II
Specialist II

Hi Jamie, the easier way would be for you to share your dashboard. Unfortunately I can't help you: I don't have access to Qlik Sense anymore as I changed company and the application is not free anymore. 

0 Likes
Contributors
Version history
Last update:
‎2019-10-11 01:43 PM
Updated by: