Book Image

Tableau 2019.x Cookbook

By : Dmitry Anoshin, Teodora Matic, Slaven Bogdanovic, Tania Lincoln, Dmitrii Shirokov
Book Image

Tableau 2019.x Cookbook

By: Dmitry Anoshin, Teodora Matic, Slaven Bogdanovic, Tania Lincoln, Dmitrii Shirokov

Overview of this book

Tableau has been one of the most popular business intelligence solutions in recent times, thanks to its powerful and interactive data visualization capabilities. Tableau 2019.x Cookbook is full of useful recipes from industry experts, who will help you master Tableau skills and learn each aspect of Tableau's ecosystem. This book is enriched with features such as Tableau extracts, Tableau advanced calculations, geospatial analysis, and building dashboards. It will guide you with exciting data manipulation, storytelling, advanced filtering, expert visualization, and forecasting techniques using real-world examples. From basic functionalities of Tableau to complex deployment on Linux, you will cover it all. Moreover, you will learn advanced features of Tableau using R, Python, and various APIs. You will learn how to prepare data for analysis using the latest Tableau Prep. In the concluding chapters, you will learn how Tableau fits the modern world of analytics and works with modern data platforms such as Snowflake and Redshift. In addition, you will learn about the best practices of integrating Tableau with ETL using Matillion ETL. By the end of the book, you will be ready to tackle business intelligence challenges using Tableau's features.
Table of Contents (18 chapters)

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