How to make Toggle Switch for Worksheets in Tableau

Today we’ll be learning how to make Toggle switch or Sheet Selector for worksheets or say how to use ‘Parameter as Filter’. This is very useful when you want to show different sheets with different filters and also the use of Parameters in Tableau. Tableau workbook is attached for download and I have used Superstore data for the tutorial.

We already have three sheets in our workbook.

 

Step 1. Creating Parameters and Calculated Field in Tableau

In the first step we’ll be creating Parameter. This parameter will be used for filters. First create a new worksheet and then go to parameters from the left menu and right-click and then click to ‘Create Parameter’.

1

A new Create Parameter window will pop-up. Give any name to the parameter. Then Select Data Type as String. Add a list of Values (Sheet 1,2,3) as shown in figure.

2

Then you can the new parameter you just created in parameter card.

Now for the next step we’ll be create a new calculated field. Go to Analysis > Create Calculated Field.

3

A new create calculated field window will appear, Create a calculated field as shown in figure.

4

 

Step 2. Creating Filters for Toggle switch

In this step we’ll be creating filters for Toggle switch for worksheets. Open the worksheet you want o create Toggle switch for. Add the created field (Display in this case) in filters card.

5

After this a Filter window will appear. Select ‘Custom value List’ and add the first Parameter value we have created. I have added Sheet 1 and then click + and then OK.

6

 

Now go to Parameter we have created and then click on ‘Show Parameter Control’.

7

You’ll see the parameter filter on the right side of the worksheet and select Sheet 1. Parameter value and Filter value must be same.

9

Repeat the Step 2 for the others worksheets too.

For Sheet 2

10

and for Sheet 3

11

Step 3. Adding Sheets to the Dashboard

Create a Container and add all the sheets to that container and that’s done.

12

Today we learnt to use parameter as filter. This method is very useful if you want to show different sheets for different filters. By changing the calculated field filters can be changed.

Download the Workbook here!

 

4 comments

  • Super and very nice feature. it is good waiting fro more new techniques from you NIKIT. Keep it Up:)

  • These tutorials all make the last step sound so easy, but it simply doesn’t work. Adding multiple sheets to a container causes them to occupy an equal proportion of the container. You can show one view at a time, but the hidden views are displayed as white space.

    For the love of God, will somebody please explain how to get EACH VIEW to occupy the entire contained when selected?

  • Ron the Bear, the way you do this is by selecting the views inside of the vertical or horizontal container and having them all set to fit “Entire View.” Another tip, remove the title of the view as Titles are not effected by the parameter just the contents of the view.

Leave a Reply

Your email address will not be published. Required fields are marked *