Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vsabbise
Creator
Creator

How to map a county point layer successfully ?

Hi All,

I am trying to plot County level data on a map (Qlik Sense Desktop) but unfortunately because of duplicate county names per state I am not able to do it successfully. This is resulting in plotting of a county pertaining to one state in a other State.

For Example:  County Named 'Lee County' exists in both Texas & Florida. 

But the correct state that is corresponding to the county in my data is for Texas only. However Qlik Sense puts Lee County in Florida.

I need to plot County level data across the United States not limiting to one state. Can some one let me know how to handle this scenario ?

As you can see in the image. I wanted to plot Texas counties on the map but  some American states share same county names causing the issue.  1) How can I restrict the counties to Texas alone ?  2) How can I do this for all the states in one map ?

Texas County MapTexas County Map

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Patrik_Lundblad
Employee
Employee

Hi Vsabbise,

If you use the "scope for locations" options in your point layer you can further specify the location of your cities. 

I don't have exactly the same data as you and will use city instead. But the procedure is the same. 

This is what it looks initially with scope set to auto. American cities are spread across the world. 

Scoping_1.PNG

 

If I turn off auto I get some options, one being the location type. I will first switch this from Auto to City. This is where you would pick something else. I believe admin level 2 is counties?

Scoping_2.PNG

The next step is to specify the country that these cities are located in. It can either be a field from your data table or it can be a string (or a list of strings). In my case I'm going to start by specifying the country as a string. As you can see I've now located all the cities to the correct country. 

Scoping_3.PNG

The next step is to scope the location on Administrative level 1. Which for USA is States. In my data table for city I have a state for each city. So I will add that field. Then Sense when doing a lookup of the city location will limit the lookup to the State connected to the city. 

Scoping_4.PNG

 

Let me know if this helps.

Regards,

Patrik.

View solution in original post

13 Replies
YoussefBelloum
Champion
Champion

Hi,

try to make your county names distinct, Concatenating the State name to the county name for example.

Example:

 county name: Lee_Florida or Lee_Texas

vsabbise
Creator
Creator
Author

I have already done that but can Qlik Sense recognize the calculated field and map it accordingly ?

YoussefBelloum
Champion
Champion

How are you displaying your counties on the map ? Coordinates ? or using data preparation ?

you should have different coordinates for each distinct county

vsabbise
Creator
Creator
Author

I just have the names of the counties not their Latitude/Longitude. Generally I have some success plotting just using the names in Qlik Sense. 

You are correct. The problem would be solved if I have coordinates but I don't have them right now and is there a way to deal with just the names ?

YoussefBelloum
Champion
Champion

I don't think that it can be solved using the names.. It means that in Qliksense geographic repository there is only one Lee County, which is the one of Florida State.

Take a look at Gadm.org or something similar to this: https://www.census.gov/geo/maps-data/data/kml/kml_counties.html

If you can't find the counties coordinates, try using Kml files that you can found on the link above, and use GeoGetPolygonCenter to generate the central point of each county.

Patrik_Lundblad
Employee
Employee

Hi Vsabbise,

If you use the "scope for locations" options in your point layer you can further specify the location of your cities. 

I don't have exactly the same data as you and will use city instead. But the procedure is the same. 

This is what it looks initially with scope set to auto. American cities are spread across the world. 

Scoping_1.PNG

 

If I turn off auto I get some options, one being the location type. I will first switch this from Auto to City. This is where you would pick something else. I believe admin level 2 is counties?

Scoping_2.PNG

The next step is to specify the country that these cities are located in. It can either be a field from your data table or it can be a string (or a list of strings). In my case I'm going to start by specifying the country as a string. As you can see I've now located all the cities to the correct country. 

Scoping_3.PNG

The next step is to scope the location on Administrative level 1. Which for USA is States. In my data table for city I have a state for each city. So I will add that field. Then Sense when doing a lookup of the city location will limit the lookup to the State connected to the city. 

Scoping_4.PNG

 

Let me know if this helps.

Regards,

Patrik.

vsabbise
Creator
Creator
Author

Awesome. This worked like charm. I can't believe I haven't tried this. Thanks a lot for your help. Qlik Sense is Awesome 🙂 

Texas County_Perfect.PNG

vsabbise
Creator
Creator
Author

Hi YoussefBelloum,

This might be helpful for certain scenarios. Thanks for your help.

BU
Partner - Contributor III
Partner - Contributor III

Hi all, i'm trying to set the location using a list of string -> ('ITA'|'MLT') but it doesn't work. Anyone have an idea to resolve this problem?

Thx a lot.

 

Ale