Dec
29
2015

How to create an India Map on Tableau

2This article explains the basic concepts of map views, and demonstrates how you can create a map view in Tableau.

Theory/Information:

Tableau automatically assigns geographic roles to fields with common geographical names, such as Country, State/Province, City, etc. Fields with a geographic role will automatically generate longitude and latitude coordinates on a map view. Geographic roles can also be manually assigned to fields that are not automatically recognized. Fields with assigned geographic roles will have a globe icon next to them.

1

Steps to Reproduce:

Let’s use the sample file, Sample – Superstore Sales (Excel). Open a new worksheet and select Sample – Superstore Sales (Excel) as the data source.

Once the data is loaded, perform the following steps to create a map with markers encoding information of a measure:

Step 1:

Go to the URL: http://www.gadm.org/country and Select country as “INDIA” and File Format as “Shapefile” and click OK.

(You can also download India_Geo codes.xsl or Ind_adm2_Points.csv (Download links Present at the bottom of the Page))

3

Step 2:

Open a new workbook by clicking on New under the File menu. Click on Connect to Data to select the data file. Under the In a file options, click on Excel File.

Step 3:

Select India_Geo codes.xsl/ Ind_adm2_Points.csv from your downloaded file’s location and hit Open. Maintain all the default options and hit OK.

Step 4:

Double-click on the State field in the Data window. Tableau automatically creates a geographic visualization using the Latitude (generated), Longitude (generated), and State fields. Based on the fields and shelves you have used, Tableau has switched the automatic mark type to filled maps. You can see that there is something wrong with the Map because few states are not shown like Jharkhand, Uttar Pradesh etc. This often happens because your data values may be spelled incorrectly or use an abbreviation that Tableau does not recognize.

When this happens those values are marked as unknown in the lower right corner of the view .In the lower right area of the map, there is a gray pill that includes the text (5 unknown). This indicates that five geographic records are missing or unrecognized in the data set.

4

Step 5:

Clicking on the pill opens the special values menu that provides three options for dealing with the unknown record:

  1. Editing the locations (to correct the error)
  2. Filtering the data (to exclude the record)
  3. Showing the data at the default position (this means zero)

5

Clicking the edit location option exposes the special values menu you see in the upper left area

6

When this happens, you can edit the unknown location names to map to known locations. This ability to quickly identify and correct non-conforming records will save your time.

7

tipsTableau provides quite a few options to change the format of a generated map. Some of the options include washout, to make the map transparent, and removing borders. By customizing maps this way, we improve the readability as well as increase the efficacy of the maps.

  1. Uncheck the box in front of Base to make the map look more clean and aesthetically pleasing.
  2. Uncheck the box in front of Light State Border & Names to make the map look even cleaner, since the map is already grouping the states.
  3. Drag the Washout slider to 100 percent if you want to see only the filled map with no other additional information.

8

How Mapping works.

Once we loaded the data, Tableau assigned geographic roles to State, City, and Customer Zip Code using field names. Tableau also generated Latitude and Longitude for these geographic roles. When we clicked on the symbol of maps, Tableau automatically added State to the Level of Detail pane and placed marks for every state that was present in the data. If you add Customer Zip Code to the Detail box, Tableau will generate markers by zip code and adjust the mark size for the respective Measure say Profit value of that zip code.

There’s more.

Tableau provides these powerful features using various data providers listed on Tableau’s website: http://www.tableausoftware.com/mapdata

If these maps do not meet your needs, Tableau also has the option of using an open technology called Web Map Services (WMS) to get the map source. You can read about using a WMS server at http://onlinehelp.tableausoftware.com/current/pro/online/enus/maps_mapsources_wms.html.

10

https://drive.google.com/file/d/0BzrUmjuUfN4jRzZJMUJIdXVxcGM/view?usp=sharing

https://drive.google.com/file/d/0BzrUmjuUfN4jLUxaY21TaDh1TXc/view?usp=sharing

 

 

 

 

 

 

 

Related Posts

About the Author: Rajeev Pandey

I’m Rajeev, Tableau Ambassador, Tableau featured Author,Pro Tableau Tech Reviewer, Data Evangelist from Hyderabad, India. I am a multidisciplinary designer working in data visualization, interaction design and innovation. Expertised in developing Tableau , Web focus based visualization and reporting applications.I am quick learner who can absorb new ideas and can communicate clearly and effectively.I love creativity and enjoy experimenting with various technologies.