Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST

How to create a location trail using Geo Animator.

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
antman
Employee
Employee

How to create a location trail using Geo Animator.

Last Update:

Apr 2, 2021 4:38:32 AM

Updated By:

antman

Created date:

Aug 15, 2019 6:17:00 AM

Attachments

At a recent Qlik Health and Public Sector conference I was asked to demonstrate how the Geo Animator works from one of the participants. In particular they wanted to know if the Geo Animator could accumulate the selected values rather than cycle over each. This was simple, yes you can. Just tick the Aggregate option in the Geo Animator properties. Secondly I was asked if you could play back Geo Locations as well as showing a trail of x amount of previous steps. 

So in response to the second question I have put together a demonstration and here is how you could build it.

Firstly I will assume that you have a suitable dataset to work with. I created a dataset showing two individuals who were recorded at discreet locations over a period of 10 hrs. This is good use case for Geo Animator.

 

General Notes: This application is using a custom dark theme as well as a dark themed Esri Map GeoData layer. These are not necessary for building the app, however the app will look different to the provided screenshots. Be sure to choose appropriate colors to contrast correctly to your base map.

 

Option 1 - Red Leader

Pre-requisites: Dataset  & Geo Analytics Installation.

Description: All locations stay visible even if selection made. Current Selected Location is Red, all others are White.

Instructions: Start by creating a Geo Analytics Map from the Extensions Panel. Create a Bubble Layer. Add your Location Identifier as ID. Under Location add your Location Field. In my example I have a separate Lat and Long, so I merge them together as Measure Item. Using some set analysis we can ensure that all locations are always visible using only({1} location_id). Only() can be used when you have no other logical aggregation function to use for your measure and {1} is our set analysis to disregard any user selections.

2019-08-15 15_49_12-.png

Navigate to Appearance - Color. Create a measure or use master measure as I have done with something like

if(only({1} location_id) = max(total location_id),1,0)

Using all locations (regardless of selection) compare if this particular location is the max location in the current selection. If True return 1 and if False return 0. This will assign either the highest color in the spectrum or the lowest. The max calculation works for me because my location ids are sequential starting 1. If your ids are not integers you could easily use if(only({1} location_id) = only(total location_id),1,0) instead. Notice how we need to make a comparison to the currently selected value using total. It is a little difficult to explain why this works, but feel free to change the identifiers and qualifiers to see what happens!

Option 1Option 1

Next you can just add your Geo Animator from the Extensions panel and use an appropriate field to cycle over. In my example I used the Location Timestamp as it was unique for each location.

Optional: You could add a Bar Chart to highlight when each location occurred using the following

Dimension: Timestamp

Measure: count({1} location_id)

Color: if(only({1} location_id) = only(total location_id),1,0) 

X Axis (Dimension): Use Continuous scale to follow example in the screenshot

 

Option 2 - Trailing Tail

Pre-requisites: Dataset  & Geo Analytics Installation. Option 1 has been built.

Description: All locations stay visible even if selection made. Current Selected Location is Red, next x amount are Orange and all others are White.

Instructions:  All we need to do is modify the bubble chart color expression from 'Measure' to 'Expression' and paste the following code. The below image is what I am using but you could do something like this to avoid having to setup a variable. 

=if(only({1} location_id) = only(total location_id),ARGB(255,255,0,0),

if(only({1} location_id) < only(total location_id) and only({1} location_id) > only(total location_id) - 3, ARGB(180,255,153,151),

ARGB(80,217,217,217 ) ) )

The first if statement tests for the Red Leader, the second part test for anything less than Red Leader 'AND' more than Red Leader minus 3 steps, and then there is the default option. We are using ARGB so that we can emphasize the Red Lead, then the Orange trail is slightly more transparent and the default white are heavily transparent. Note that this statement needs to saved directly in the Color Expression so that we can specify the three colors Red, Orange and White.

2019-08-15 15_50_34-.png

2019-08-15 15_50_17-Mapping Animation - Doctor Shopping - Follow the Trail _ Sheets - Qlik Sense.png

2019-08-15 20_12_50-.png

Optional: You could change the bar chart color properties so that is also displays the trailing tail. Just re-use the above color expression in your bar chart.

 

Option 3 - Stay on Target

Pre-requisites: Dataset  & Geo Analytics Installation. Option 1&2 has been built.

Description: Current Selected Location is Red, next x amount are Orange. No other locations are displayed. This gives the appearance that we are following the target more closely.

Instructions:  All we need to do is modify the bubble chart Location measure and use a similar if statement to remove all the white locations. Use the following expression as you updated Location Measure.

if(only({1} location_id) <= only(total location_id) and only({1} location_id) > only(total location_id) - 3,

'['&only({1}b_long)&','&only({1}b_lat)&']',

''

)

Here we are mixing elements of the original location measure and the new color expression. We only need one if statement because we are testing for Red Leader and Red Leader minus 3. If the location is not in the first test we make it '' which removes it from the map. The result is that the map is able to focus more closely to the locations which are usually closer together. Don't forget to make sure that your map object settings is configured for 'Zoom to Selection'.

2019-08-15 15_51_34-Mapping Animation - Doctor Shopping - Adjust and Follow Close _ Sheets - Qlik Se.png

2019-08-15 20_14_41-.png

 

Conclusion: There you have it, try it for your self and make some cool Geo Animations!

Tags (1)
Labels (1)
Comments
Patric_Nordstrom
Employee
Employee

Great post, thanks for sharing!

0 Likes
Version history
Last update:
‎2021-04-02 04:38 AM
Updated by: