Search icon CANCEL
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 2019.x Cookbook

You're reading from   Tableau 2019.x Cookbook Over 115 recipes to build end-to-end analytical solutions using Tableau

Arrow left icon
Product type Paperback
Published in Jan 2019
Publisher Packt
ISBN-13 9781789533385
Length 670 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (6):
Arrow left icon
Tania Lincoln Tania Lincoln
Author Profile Icon Tania Lincoln
Tania Lincoln
Slaven Bogdanovic Slaven Bogdanovic
Author Profile Icon Slaven Bogdanovic
Slaven Bogdanovic
Teodora Matic Teodora Matic
Author Profile Icon Teodora Matic
Teodora Matic
Rintaro Sugimura Rintaro Sugimura
Author Profile Icon Rintaro Sugimura
Rintaro Sugimura
Dmitry Anoshin Dmitry Anoshin
Author Profile Icon Dmitry Anoshin
Dmitry Anoshin
Dmitrii Shirokov Dmitrii Shirokov
Author Profile Icon Dmitrii Shirokov
Dmitrii Shirokov
+2 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Getting Started with Tableau Software 2. Data Manipulation FREE CHAPTER 3. Tableau Extracts 4. Tableau Desktop Advanced Calculations 5. Tableau Desktop Advanced Filtering 6. Building Dashboards 7. Telling a Story with Tableau 8. Tableau Visualization 9. Tableau Advanced Visualization 10. Tableau for Big Data 11. Forecasting with Tableau 12. Advanced Analytics with Tableau 13. Deploy Tableau Server 14. Tableau Troubleshooting 15. Preparing Data for Analysis with Tableau Prep 16. ETL Best Practices for Tableau 17. Other Books You May Enjoy

Building a dual-axis map

In this recipe, you will learn how to create a dual-axis map. We will build on what we learned in the Building a map recipe and learn how to implement a dual axis.

Getting ready

Connect to the Baby_names.csv dataset and open a new worksheet.

How to do it...

  1. Drag and drop State from Dimensions into the worksheet workspace so that a basic map appears.
  2. Drag and drop Latitude (generated) from Measures into the Rows shelf to the right of the Latitude (generated) pill, which is already there:

Now we have two maps, one beneath the other. Also, notice how new sections have appeared in the Marks card. There is the All section, followed by Latitude (generated), which refers to the upper map, and Latitude (generated) (2), which refers to the bottom map:

  1. Click on the second section, Latitude (generated), in the Marks card to expand it.
  2. Drag and drop Frequency from Measures onto Color:
  1. Click on the Color button and select Edit Colors….
  2. From the Palette drop-down menu, select Gray, and click on OK:
  1. Click on the Color button again, and use the slider to decrease the opacity to around 51%:

  1. Click on the third section, Latitude (generated) (2), to expand it. In it, drag and drop Gender from Dimensions onto Color.
  2. Drag and drop Frequency from Measures onto Size.
  3. Click on the Automatic drop-down menu and change the mark type to Pie:
  1. Let's set the dual axis. In the Rows shelf, hover over the second Latitude (generated) pill so that a small white arrow appears on it:
  1. Click on the arrow, select Dual Axis, and you will get the following result:

How it works...

Adding the Latitude measure to the Rows shelf twice duplicates our view, making two maps instead of one. The two maps initially have the same specifications in the Marks card and State in Detail. However, we then build them separately by adding different dimensions and measures on each of them, and they show different information. We have finally implemented the dual axis, and we have also made the maps overlap. We ended up with one map that has two layers.

There's more...

The dual axis can be implemented with different types of visualizations, not just maps. In the following example, we can see two different measures in the rows so that the upper bar chart shows Frequency and the lower chart shows Number of Records:

If we implement dual axis, both measures will be displayed in one chart:

However, we must notice that the new chart has two y axes on each side—one showing Frequency and the other showing Number of Records. The axes are very different, as these two measures have different scales, thus showing that the same scale would make the measure with the narrower scale, in this case, Number of Records, look flat on the chart. However, Tableau does offer an option for synchronizing the axes, which is useful when the scales are similar.

To implement it, right-click on any of the two y axes and select Synchronize Axis:

See also

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 ₹800/month. Cancel anytime