How do I swap sheets in Tableau?
How do I swap sheets in Tableau?

Quite often if you have a lot of information to communicate on your dashboard you are going to want to swap between sheets. Thankfully, building this capability is quite easy and the key to it is organisation and good labelling.

First you will need to create the relevant sheets. For the sake of this exercise we are going to use EU Superstore Data and build a quick Line Chart and a Scatterplot which we will swap between on our dashboard.

Build your Line Graph in Tableau

Start by giving your sheet a title then drag Order Date onto the Columns Shelf and making sure to use the drop down to change the Dimension to Continuous Month.

Swap Sheets in Tableau

Bring your SUM(Sales) onto the Rows Shelf and now we have a Line Graph. It should automatically become a Line Graph but if not you can change it from the drop down in the Marks card. Park that and move on to our second sheet – a Scatterplot.

Swap Sheets in TAbleau

Build your Scatterplot in Tableau

Click on the plus icon beside the Line Graph Sheet at the bottom of the view. Here you will see Sheet 2. Double Click on that, name this Scatterplot and hit return.

Now we need to drag our SUM(Sales) on to our Rows Shelf and our SUM(Profit) onto our Columns. Then bring Customer Name onto Detail in the Marks Shelf and we have our Scatterplot. Note that both Sheets are labelled correctly from the very beginning.

Swap Sheets in Tableau

Create the Parameters

From the dropdown on the Measures and Dimensions shelf select Create Parameter. Give the pop up a title in this case we will call it Pick a Chart. Choose your data type as String and then tick List to show the viewer what charts they can choose between – Line Graph and Scatterplot. These must be named as is exactly on the Sheets or they will not show.

Swap Sheets in Tableau

Swap Sheets in Tableau

You need to Create a Calculated Field to reference the Parameter.

GET MORE GREAT TABLEAU TIPS AND TRICKS ON OUR YOU TUBE CHANNEL (AND DON’T FORGET TO SUBSCRIBE)

Do this by going back up to the top of the Dimensions and Measures Shelf and from the dropdown select Create Calculated Field. Name the pop up – Chosen Chart – and then drag the newly created Parameter Pick a Chart into the pop up. You will see that new Calculated Field appears at the top of the Dimensions and and Measures Shelf.

Swap Sheets in Tableau

Swap Sheets in Tableau

Swap Sheets in Tableau

We now need to apply the filtering. So drag Chosen Chart onto the Filters Shelf and tick Line Graph and Exclude. We do this because we are telling Tableau that we don’t want to see the Scatterplot when the Line Graph is on our Dashboard. Then we need to go to the other Sheet Line Graph and tell Tableau that we do want to see the Line Graph when the Line graph is on the Dashboard. So in this case we don’t tick Exclude.

Swap Sheets in Tableau

Swap Sheets in Tableau

Now we are ready to build the Dashboard. Click on the New Dashboard icon below

Swap Sheets in Tableau

When we get into the workspace you will see our two sheets are ready to go. Click on the Vertical to set up your dashboard and then drag both sheets onto the dashboard. You will see that one of them doesn’t show. This is because you have created the swap. So you will need to show the Parameter Pick a Chart so now the viewer knows they have the option to swap between the two sheets.

Swap Sheets in Tableau

At this point you  probably want to choose the Hide Title options on both charts – viewers don’t really need to know what these chart types are called and it also means that you dont have the title of each chart lurking under one another when not in use. Don’t forget to make sure your formats are all ok (we have to change £ to € as we are using) and take out anything you don’t need, such decimals and so on.

Being able to swap sheets like this can save you space on a large dashboard and is handy for dashboards with lots of sheets.

Swap Sheets in Tableau

Swap Sheets in Tableau

About The Information Lab Ireland

The Information Lab Ireland is at the forefront of creating a data-driven culture in Ireland.

As part of its vision, The Information Lab Ireland regularly hosts free events throughout the country to show how being data-driven can improve decision making and lead to a better understanding of the world around us. For more on these events please like us on Facebook, follow us on Twitter or catch up with us on LinkedIn