Diffrerenttypesof Maps
Diffrerenttypesof Maps
It contains location names that Tableau can geocode. Build a map view, the location names reference the geometries stored in
the Tableau Map Service based on the geographic role you assign to the field. Open Tableau Desktop.
3. Navigate to Documents > My Tableau Repository > Data Sources, and then open the Sample - Superstore.xls file.
Once you connect to the data source, your screen will look like this:
This is called the Data Source page, and it is where you can prepare your location data for use in Tableau.
Some of the tasks you can perform on the Data Source page include the following, but you don't have to do all these things to
create a map view:
Your data is often held in multiple data sources or sheets. As long as those data sources or sheets have a column in common,
you can join them in Tableau. Joining is a method for combining the related data on those common fields. The result of
combining data using a join is a virtual table that is typically extended horizontally by adding columns of data.
Joining is often necessary with geographic data, particularly spatial data. For example, you can join a KML file that contains
custom geographies for school districts in Oregon, U.S. with an Excel spreadsheet that contains demographic information
about those school districts.
For this example, you will join two sheets in the Sample-Superstore data source.
1. On the left side of the Data Source page, under Sheets, double-click Orders.
Tableau creates an inner-join between the two spreadsheets, using the Region column from both spreadsheets as the
joining field. Now there is a sales person assigned to every location in your data source, as well as to regions.
To edit this join, click the join icon (the two circles). You can edit the join in the Join dialog box that opens. For more
information about joining data in Tableau,.
After set up your data source, might need to prepare your geographic data for use in Tableau. Not all of these procedures will
always be necessary to create a map view, but it's important information to know when it comes to preparing geographic data
for use in Tableau.
Depending on the type of map you want to create, you must assign certain data types, data roles, and geographic roles to your
fields (or columns).
For example, in most cases, your latitude and longitude fields should have a data type of number (decimal), a data
role of measure, and be assigned the Latitude and Longitude geographic roles. All other geographic fields should have
a data type of string, a data role of dimension, and be assigned the appropriate geographic roles.
When you first connect to geographic data, Tableau assigns data types to all of your columns. These data types include
Number (decimal), Number (whole), Date and Time, Date, String, and Boolean. Sometimes Tableau does not get these data
types right, and you must edit them. For example, Tableau might assign a Postal Code column a data type of Number (whole).
To create map views, your Postal Code data must have a data type of String.
1. On the Data Source page, click the data type icon (the globe) for Postal Code and select String.
For more information about data types,
Assign geographic roles to your geographic data
In Tableau, a geographic role associates each value in a field with a latitude and longitude value. When you assign the correct
geographic role to a field, Tableau assigns latitude and longitude values to each location in that field by finding a match that is
already built in to the installed geocoding database. This is how Tableau knows where to plot your locations on the map.
When you assign a geographic role to a field, such as State, Tableau creates a Latitude (generated) field and a Longitude
(generated) field.
Geographic roles are sometimes automatically assigned to your data, such as in this example. You can tell a geographic role
has been assigned to your data because the column includes a globe icon.
If a geographic role is not automatically assigned, you can manually assign one to your field. You don't need to do so for this
example, but it's important to know how so you can do it for your own data.
2. Select Geographic Role, and then select a role that best matches your data.
For example, in this case, the Country column does not have a geographic role assigned to it, so the Country/Region
geographic role is assigned.
Note: If you have difficulties assigning geographic roles to your data, or have data that is not built in to the Tableau map
server, there are a few things you can do to get that data into Tableau.
Change from dimensions to measures
When you connect to geographic data, Tableau also assigns data roles to all of your columns. A column can be
a dimension or measure. In most cases, your latitude and longitude columns should be measures. For special cases, such as if
you want to plot every location in your data source on a map without the ability to drill up or down a level of detail (such as
from City to State), they can be dimensions.
You don't need to change the data role of a column for this example, but it's important to know how so you can do it for your
own data. Feel free to practice here. You can always undo any changes you make.
The fields in the data pane are divided into measures and dimensions. The fields placed in the Dimensions section of
the Data pane are often categorical data, such as Date and Customer ID, while the fields placed in the Measures
section of the Data pane are often quantitative data, such as Sales and Quantity.
2. In the Data pane, under Dimensions, select a field, such as Row ID, and drag it down to the Measures section.
The field is added to the Measures section and changes from blue to green. You just converted a Dimension to a
Measure. To convert a field from a measure to a dimension, drag the field from the Measures section up to the
Dimensions section.
1. In the Data pane, right-click the geographic field, Country, and then select Hierarchy > Create Hierarchy.
2. In the Create Hierarchy dialog box that opens, give the hierarchy a name, such as Mapping Items, and then click OK.
At the bottom of the Dimensions section, the Mapping Items hierarchy is created with the Country field.
3. In the Data pane, drag the State field to the hierarchy and place it below the Country field.
o Country
o State
o City
o Postal Code
The Country field is added to Detail on the Marks card, and Latitude (generated) and Longitude (generated) are added
to the Columns and Rows shelves. A map view with one data point is created. Since a geographic role is assigned to
Country, Tableau creates a map view. If you double-click any other field, such as a dimension or measure, Tableau
adds that field to the Rows or Columns shelf, or the Marks card, depending on what you already have in the view.
Geographic fields are always placed on Detail on the Marks card, however.
Since this data source only contains one country, (United States), that is the only data point shown. You will need to
add more levels of detail to see additional data points. Since you created a geographic hierarchy, this is easy.
The State field is added to Detail on the Marks card and the map updates to include a data point for every state in the
data source.
If you did not create a hierarchy, the + icon on the Country field will not be available. In this case, to add State as
another level of detail, manually drag State from the Data pane to Detail on the Marks card.
The default map type in Tableau is often a point map. When you have geographic roles assigned to your geographic data,
however, it's easy to change those data points to polygons.
1. On the Marks card, click the Mark Type drop-down and select Filled Map.
The map updates to a polygon map.
We can add measures and dimensions to the Marks card to add visual detail to your view. In this example, you will add color
and labels to the view.
Add color
Add labels
Each state is labeled with sum of sales. The numbers need a little bit of formatting, however.
2. In the Data pane, right-click Sales and select Default Properties > Number Format.
3. In the Default Number Format dialog box that opens, select Number (Custom), and then do the following:
o For Decimal Places, enter 0.
o For Units, select Thousands (K).
o Click OK.
The labels and the color legend update with the specified format.
How to Customize your background map?
The background map is everything behind your marks (borders, oceans, location names, etc.) You can customize the style of
this background map, as well as add map layers and data layers. In addition to customizing the background maps, you can also
connect to your own WMS server or Mapbox map. For more information,.
The Map Layers pane appears on the left side of the workspace. This is where all background map customization
happens.
2. In the Map Layers pane, click the Style drop-down and select Normal.
4. At the top of the Map Layers pane, click the X to return to the Data pane.
As you build your map view, you might want to group existing locations together to create your own territories or regions,
such as sales territories for your organization.
1. In the Data pane, right-click State and select Create > Group.
2. In the Create Group dialog box that opens, select California, Oregon, and Washington , and then click Group. Each
group you create represents a territory.
Note: To multi-select, hold down Ctrl (Command on Mac) as your select states.
3. Right-click the new group you just created and select Rename.
5. For the next territory, select Alabama, Florida, Georgia, Louisiana, Mississippi, South Carolina, and Texas, and
then click Group.
7. For the third territory, select Connecticut, Delaware, District of Columbia, Main, Maryland, Massachusetts, New
Hampshire, New Jersey, New York, Pennsylvania, Rhode Island, Vermont, and finally, West Virginia, and then
click Group.
8. Rename this group, East Coast.
A State (group) field appears in the Data pane beneath your other mapping items.
12. From the Data pane, drag State (group) to Color on the Marks card.
13. On the Marks card, click the Color icon and select Edit Colors.
14. In the Edit Colors dialog box that appears, select Assign Palette, and then click OK.
When you hover over a state, a tooltip appears with the sales for that state, among other information. You'll learn how
to edit this tooltip later.
16. On the Marks card, click the minus (-) icon on the Country field to remove State from the level of detail.
If you did not create a hierarchy, you can drag State from the view to remove it. You can remove any field by
dragging it from the view.
The states no longer appear on the map. Notice how the sum of sales has updated for the labels and in the tooltip? This
is because custom territories aggregate at the level of the group, rather than separately for each location within the
group. So the sum of sales your are seeing in the West Coast group, for example, are the total sales for California,
Oregon, and Washington combined.
How Create a dual axis map?
So far you have created two map views: one that shows the sales per state, and one that shows the sales per region. Could you
layer these maps on top of one another? Yes! In Tableau, you can create a map with two layers of marks. This is called a dual
axis map in Tableau, and is often used to layer points over polygons. In this example, you will layer two polygons maps.
1. From the Data pane, drag Longitude (generated) to the Columns shelf and place it to the right of the first Longitude
field.
3. From Measures, drag Sales to Coloron the top Longitude (generated) Marks card.
4. On the top Longitude (generated) Marks card, click the + icon on the Country field to drill back down to the State
level of detail.
5. On the Marks card, click Color, and then select Edit Colors.
6. In the Edit Colors dialog box that opens, click the Palette drop-down, select Gray, and then click OK.
9. On the bottom Longitude (generated) Marks card, drag both SUM(Sales) fields from the view to remove them.
10. On the bottom Longitude (generated) Marks card, click Color, and then, for Opacity, enter 50%.
This is a crucial step if you want to be able to see the map on the bottom layer.
12. Copy the following text and paste it into the Edit Tooltip dialog box, and then click OK:
Congrats! You've created a dual axis map! There's only one thing left to do.
For more information about dual axis maps, see Dual Axis Mapping - Many Ways(Link opens in a new window) on
the Tableau Community.
How Customize others can interact with your map?
Now that you have created your map view, you can customize how people will interact with it. For example, you might now
want anyone to be able to zoom in or out of your map, or pan. Or perhaps you want to display a map scale? You can customize
these two options and more in the Map Options dialog box.
A scale appears in the bottom-right corner of the map, and the map search icon and the toolbar in the top left corner of
the map disappear. You can still pan and zoom using keyboard shortcuts.
Different types of maps.
Tableau Proportional symbol
maps Tableau Choropleth maps
(filled maps) Tableau Point
distribution maps Tableau
Heatmaps (density maps) Tableau
Flow maps (path maps)
Tableau Spider maps (origin-destination maps)
To build a Simple Tableau Custom Map, you need a data source, like Sample-
Superstore data, consisting of location data, location names, latitude, longitude
coordinates. Without geographical coordinates, you can’t prepare map visualization
in Tableau. A simple Tableau Custom Map can be
m enting the following steps:
created by imple
Step 1:O pen Tableau Desktop, connect to the Sample-Superstore data source, and the
worksheet will open in front of your screen.
Step 5: Move your cursor to the Maps tab and choose Map Layers from the drop-down list.
A simple Polygon or Filled Tableau Custom Map helps you understand the basic
mapping concepts in Tableau. The following steps can be implemented to create a
Polygon Tableau Custom Map:
Step 1: Drag the State parameter from the Data pane to the worksheet.
Step 2: Move your cursor to the Marks pane, choose the Map option from the
drop-down list.
Step 3: The worksheet will show the following visualization of the map.
Step 4: Select the Sales parameter from the Data pane and place it over the map.
You can see the Number of Sales from the polygons in the updated map.
Tableau Desktop enables you to design the following types of maps depending upon
your business needs and visualization requirements. The different kind of custom
maps that can be created on Tableau are as follows:
Choropleth Maps, also known as Filled Maps, are perfect to represent ratio and
aggregated data. Users can use ratio or aggregated data for polygons that can be
related to locations, such as countries, regions, states, or any area.
For simplicity, download Tableau Example Workbook and implement the following
steps to show ratio or combined data in Tableau Desktop:
Step 1: Go to Worksheet Tab and select the New Worksheet from the drop-
down list or press CTRL+M. A New Sheet will open.
Step 2: Under the State, Country dimension, select the State option and move to the
sheet.
Step 6: Click on the plus symbol of State to get details of all countries, as shown below.
Step 7: Place your cursor over Percent- 2012 and drop it over the color option.
Step 8: To get the obesity percentage range, select the Edit Colors
option from the Color icon.
Step 9: Select the Purple color and click Apply.
Step 10: Open the Effect option from the Color icon.
Step 11: Select the None option from the Border list.
The output of the Choropleth will appear in front of your screen.
Step 12: In the above map, Tableau selected the default color distribution.
However, if you want to change it, go to the Edit Color menu again. Mark
the Stepped color and enter 8. Click on the Apply button and close it.
Step 13: Repeat the same steps, but this time select 5.
Step 14: The map view for 4 Stepped Color might look like this.
By selecting 4 instead of 5, you will understand that obesity rates are higher in the South.
However, prior maps were showing even distribution of colors or obesity rates in the
United States (US). All the maps are great to show aggregate data, yet each is giving
you prominent information on obesity rates in different countries.
Similarly, if you want to plot the map for a State Level detail, remove the County from
the Marks chart. You can analyze that Texas has higher obesity rates, followed by Georgia.
Tableau Business Intelligence tool allows users to determine the flow of path over time,
e.g., the path of the storm, through Flow or Path Maps. To create Flow Maps in
Step 1: Open the downloaded example in Tableau Desktop.
Step 2: Open a New Worksheet.
Step 3: Move Latitude and Longitude coordinates using the drag-and-drop method.
Step 4: Choose the Storm Name and place it over the Details icon in the Marks pane.
Step 5: To apply filters, select the Date from the Data pane and
place it over the Filters area.
Step 6: Choose Year, such as 2012.
Step 7: Click on Apply and close the screen.
Step 8: Repeat the same steps for Bhasin and select the West Pacific region.
Step 9: Select Normal Background from the Map tab. The final map might look like this.
Step 12: Click on the Date parameter, select an Exact Date option.
Step 13: Drag the Wind Speed (kt) from the Data pane and place it over the Size icon.
Step 14: Right-click over the Wind Speed (kt) and choose the Average parameter.
Step 15: Place Storm Name over the Colors icon to complete the Flow Map.
3) Proportional Symbol Tableau Custom Maps
A Proportional Symbol Map is a great start to acquire quantitative values for individual
locations. Nevertheless, your data source should contain quantitative values,
longitude and latitude coordinates to create Proportional Symbol Maps.
Step 5: Select the ID from the Data pane and place it over the Details icon.
Step 6: A dialog box will appear, select Add All Members.
Step 7: Select Magnitude^10 and place it over Size in Marks.
Step 14: Right-click over the ID and select the Sort option.
Step 15: Choose Descending for Sort Order option.
Step 16: Choose Fields for Sort By option and then choose Magnitude.
Step 17: Click OK.
Step 18: Select any appropriate background for your map. The final image of the map
might look like this.
Everyone loves to spot visual clusters, and Tableau Desktop makes this process super
easy through Point Distribution Maps. But your data source should have longitude
and latitude coordinates to map visual clusters. Download the Example Workbook
right now and implement the following steps:
Maps give an easy-to-infer advantage over the other charts that are available in Tableau.
If the available population data is consumed on the map, we can comprehend which
regions are densely/scarcely populated at a glance.
If your data set contains any kind of spatial data viz. State-wise or Country-wise data,
Tableau auto-generates the respective latitude and longitude for the spatial fields that
are available in the data set. However, the latitude and longitude fields that are auto-
generated by Tableau can only be used for generating the maps and cannot be used in
any of the calculation fields or parameters of the report. Tableau generates a map
with the generated longitude and latitude by just a click of that particular spatial field,
which we will be discussing later in the blog.
In Tableau Desktop, add a Mapbox map to workbook and use it as a background map.
After add a Mapbox map to your workbook, the map is saved with the workbook and available to anyone with whom you
share the workbook. You can also save a Mapbox map as a Tableau Map Source (.tms) file that you can share with others so
they can quickly connect to it and use it in their own workbooks. For more information, In Tableau Desktop,
select Map > Background Maps > Add Mapbox Map.
This URL contains the style ID for your Mapbox map, your access token, and your username. It might look
similar to the following:
https://api.mapbox.com/styles/v1/<username>/<styleid>?access_token=<access token>
3. When finished, click OK to exit the Add Mapbox Map dialog box, and then click Close to return to the view.
When you add a Mapbox Studio map to Tableau, all the map's layers are added, too. Layer groups and single layers in
Mapbox Studio will display as individual layers in the Map Layers Pane in Tableau, and will retain the layer configuration set
in Mapbox Studio.
If a layer group in Mapbox Studio includes sublayers that are turned off, those sublayers will also be turned off when the map
is added to Tableau, and the layer group will appear as a single layer in the Map Layers pane. If the layer group is turned off in
Tableau, then back on, all of that layer group's sublayers will be turned on.
Map layers are different from data layers in Tableau. In Tableau, Data Layers are pre-built tiles that include demographic
information by various levels, like State and County. Data layers and Mapbox are independent of one another in Tableau.