Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tableau 10 Complete Reference

You're reading from   Tableau 10 Complete Reference Transform your business with rich data visualizations and interactive dashboards with Tableau 10

Arrow left icon
Product type Course
Published in Dec 2018
Publisher Packt
ISBN-13 9781789957082
Length 496 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Joshua N. Milligan Joshua N. Milligan
Author Profile Icon Joshua N. Milligan
Joshua N. Milligan
Tristan Guillevin Tristan Guillevin
Author Profile Icon Tristan Guillevin
Tristan Guillevin
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Title Page
About Packt
Contributors
Preface
1. Creating Your First Visualizations and Dashboard 2. Working with Data in Tableau FREE CHAPTER 3. Moving from Foundational to More Advanced Visualizations 4. Using Row-Level, Aggregate, and Level of Detail Calculations 5. Table Calculations 6. Formatting a Visualization to Look Great and Work Well 7. Telling a Data Story with Dashboards 8. Deeper Analysis - Trends, Clustering, Distributions, and Forecasting 9. Making Data Work for You 10. Advanced Visualizations, Techniques, Tips, and Tricks 11. Sharing Your Data Story 12. Catching Up with Tableau 2018 13. Deal with Security 14. How to Keep Growing Your Skills 1. Other Books You May Enjoy Index

Creating geographic visualizations


Tableau makes creating geographic visualizations very easy. The built-in geographic database recognizes geographic roles for fields, such as country, state, city, or zip code. Even if your data does not contain latitude and longitude values, you can simply use geographic fields to plot locations on a map. If your data contains latitude and longitude fields, you may use those instead of the generated values.

Note

Although most databases do not strictly define geographic roles for fields, Tableau will automatically assign geographic roles to the fields based on the field name and a sampling of values in the data. You can assign or re-assign geographic roles to any field by right-clicking on the field in the data pane and using the Geographic Role option. This is also a good way of seeing what built-in geographic roles are available.

The power and flexibility of Tableau's geographic capabilities, as well as the options for customization, will be covered in more detail in the Mapping techniques section of Chapter 10,Advanced Visualizations, Techniques, Tips, and Tricks. In the following examples, we'll consider some of the foundational concepts of geographic visualizing.

Geographic visualization is incredibly valuable when you need to understand where things happen and if there are any spatial relationships within the data. Tableau offers two basic forms of geographic visualization:

  • Filled maps
  • Symbol maps

Filled maps

Filled maps, as the name implies, makes use of filled areas, such as country, state, county, or zip code, to show location. The color that fills the area can be used to encode values of measures or dimensions.

What if you want to understand sales for Superstore and see whether there are any patterns geographically? Let's take a look at some examples of how you can do this:

  1. Navigate to the Sales by State sheet.
  2. Double-click on the State field in the data pane. Tableau automatically creates a geographic visualization using the Latitude (generated), Longitude (generated), and State fields.
  1. Drag the Sales field from the data pane and drop it on the Color shelf on the Marks card. Based on the fields and shelves you've used, Tableau has switched the automatic mark type to filled maps:

The filled map fills each state with a single color to indicate the relative sum of sales for each state. The color legend, now visible in the view, gives the range of values and indicates that the state with the least sales had a total of $3,543 and the state with the most sales had a total of $1,090,616.

When you look at the number of marks displayed on the status bar on the lower-left side, you'll see that it is 49. Careful examination reveals that the marks consist of the lower 48 states and Washington DC. Hawaii and Alaska are not shown. Tableau will only draw a geographic mark, such as a filled state if it exists in the data and is not excluded by a filter.

Observe that the map does display Canada, Mexico, and other locations not included in the data. These are part of a background image retrieved from an online map service. The state marks are then drawn on top of the background image. We'll look at how you can customize the map and even use other map services in the Mapping techniques section of Chapter 10,Advanced Visualizations, Techniques, Tips, and Tricks.

Filled maps can work well in interactive dashboards and have quite a bit of aesthetic value. However, certain kinds of analysis are very difficult with filled maps. Unlike other visualization types, where size can be used to communicate facets of the data, the size of a filled geographic region only relates to the geographical size and can make comparisons difficult. For example, which state has the highest sales? You might be tempted to say Texas or California because they appear larger, but would you have guessed Massachusetts? Some locations may be small enough that they won't even show up compared to larger areas. Use filled maps with caution and consider pairing them with other visualizations on dashboards for clear communication.

Symbol maps

Another standard type of geographic visualization available in Tableau is a symbol map. Marks on this map are not drawn as filled regions; rather, marks are shapes or symbols placed at specific geographic locations. Size, color, and shape may also be used to encode additional dimensions and measures.

Continue your analysis of Superstore sales, following these steps:

  1. Navigate to the Sales by Postal Code sheet.
  2. Double-click on Postal Code under Dimensions. Tableau automatically adds postal code to the Detail of the Marks card and Longitude (generated) and Latitude (generated) to Columns and Rows. The mark type is set to a circle by default and a single circle is drawn for each postal code at the correct latitude and longitude. You may also notice an indicator for 1 unknown postal code. We'll take a look at how to handle this in the future chapters.
  3. Drag Sales from Measures to the Size shelf on the Marks card. This causes each circle to be sized according to the sum of sales for that postal code.
  4. Drag Profit from Measures to the Color shelf on the Marks card. This encodes the mark color to correspond to the sum of profit. You can now see the geographic location of profit and sales at the same time. This is useful because you will see some locations with high sales and low profit that may require some action.

The final view should look like this after making some slight adjustments to size and color details:

Sometimes you'll want to adjust the marks on a symbol map to make them more visible. Some of the options are:

  • If marks are overlapping, click on the Color shelf and set transparency to somewhere between 50% and 75%. Additionally, add a dark border. This makes the marks stand out and you can often discern any overlapping marks much better.
  • If marks are too small, click on the Size shelf and adjust the slider. You can also double-click on the Size legend and edit the details of how Tableau assigns size.
  • If marks are too faint, double-click the Color legend and edit the details of how Tableau assigns a color. This is especially useful when you are using a continuous field that defines a color gradient.

A combination of tweaking the size and using Stepped Color and Use Full Color Range, as shown here, produced the final result for this example:

Unlike filled maps, symbol maps allow you to use size to visually encode aspects of the data. Symbol maps also allow for greater precision. In fact, if you have latitude and longitude in your data, you can very precisely plot marks at a street address level of detail. This type of visualization allows you to map locations that do not have clearly defined boundaries. Notice that if you were to change the mark type from Automatic to Filled Map in the preceding view, you would get an error message indicating that filled maps are not supported at the level of detail in the view.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image