Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

map - country / site alternative dimension

Hello,

For map visualization, is there the possibility to have a dimension that would show on the graph either at country level, or site (city) level ?

I tried with a master item, but then I cannot find a way to switch the graph from one dimension level to the other.

Another problem is when there is no coordinates for a site, how would it be possible to associate a product with the coordinate of the country ?

Example of data model

Table1:

Country

Country.Coordinates

Table2:

Site

Site.Coordinate

Country

Table3:

Product name

Site

1 Solution

Accepted Solutions
lironbaram
Honored Contributor II

Re: map - country / site alternative dimension

like this

Table1:

Country

Country.Coordinates

Table2Temp:

Site

Site.Coordinate

Country

left join (Table2Temp)

load Country,Country.Coordinates as Country_Coordinates resident Table1

Table2:

load  * ,

        if(isnull(Site.Coordinate),Country_Coordinates,Site.Coordinate)  AS Site_Coordinates

Resident Table2Temp;

drop field Site.Coordinate,Country_Coordinates;

rename field Site_Coordinates to Site.Coordinate;

6 Replies
lironbaram
Honored Contributor II

Re: map - country / site alternative dimension

hi

first in built in map object you can't change the dimension

in works only with one dimension

and each map support only one layer

as for the coordinates you'll need to fill the site coordinates with the country data

Not applicable

Re: map - country / site alternative dimension

Hello Bra'am,

Thank you for your reply.

What would you suggest as the best option for filling the country data. Would that be in the load script, or creating a dimension variable ?

Being new to Qlik, if you have some example that would be very useful.

Not applicable

Re: map - country / site alternative dimension

Hi,

This is how it could be done with the map extension IdevioMaps, see http://bi.idevio.com (email info@idevio.com if you would like to try it):

To show country and/or site you could either define a drill down hierarchy with a country level and a site level, or you could display them both at the same time in different levels. Add a IdevioMap component, an AreaLayer for the countries and a BubbleLayer for the sites. If you have a drill down hierarchy set them do display in drill down level 0 and 1 respectively in Layer Options -> Restrict Drill Down.

With a drill down, the level will switch from country to site when only one country is selected.

I interpret it as you would like to use a center coordinate of the country when the site coordinate is null. One way would be to fix it with some loops and fixes in the load script but the easiest would probably be to add a separate Bubble Layer for these sites with the dimension like:

=if(isnull(Site.Coordinate) and not isnull(Site), Country)

Uncheck show null values.

This way the country center would be looked up in the Idevio location service and the bubble displayed only for sites missing coordinate (assuming missing coordinate means it is null). Hopefully this expression works for your data but as I have not tested it there are no guarantees

/Johan

lironbaram
Honored Contributor II

Re: map - country / site alternative dimension

like this

Table1:

Country

Country.Coordinates

Table2Temp:

Site

Site.Coordinate

Country

left join (Table2Temp)

load Country,Country.Coordinates as Country_Coordinates resident Table1

Table2:

load  * ,

        if(isnull(Site.Coordinate),Country_Coordinates,Site.Coordinate)  AS Site_Coordinates

Resident Table2Temp;

drop field Site.Coordinate,Country_Coordinates;

rename field Site_Coordinates to Site.Coordinate;

Not applicable

Re: map - country / site alternative dimension

Thank you Bra'am, this solution works well.

Not applicable

Re: map - country / site alternative dimension

Hello Johan,

Thanks for your inputs. I have not used this solution since I consider extensions complicate the sharing with other end-users.

Though I am sure other Qlik fans will appreciate your contribution.