top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

How to Swap sheets using parameters in Tableau?

What is Tableau?

Tableau is an excellent data visualization and business intelligence tool used for reporting and analyzing vast volumes of data. It helps users create different charts, graphs, maps, dashboards, and stories for visualizing and analyzing data, to help in making business decisions.

Tableau is used for:

  • Data visualization

  • To blend data

  • Translate query into visualization

  • Managing voluminous metadata

  • To create no-code data queries

  • Real-time data analysis

Tableau software is widely used because it is fast for data analysis and doesn’t require any programming skills to operate.


What is Parameter?

We will try and gain a good understanding of the parameters and their use in Tableau.

Tableau Parameters are some of the most flexible, frankly, and most awesome features of this tool. A Tableau parameter allows you or your end-user to change the content that appears in worksheets and dashboards. This can be something simple like a value or something much more advanced.

A parameter is a workbook variable such as a number, date, or string that can replace a constant value in a calculation, filter, or reference line. After creation, end users can control the input to see the results of the effect of the parameter.

Let me walk you through an example of how we can use parameters to swap sheets in Dashboards. I am going to create 3 different visualization to achieve this swap sheets.


1. I am going to create Column chart to visualize provider specialty and provider date on staff with use of Quality Dataset. Rename sheet to "Bar".



2. Now I am going to just duplicate "Bar" sheet visualization.

From the Marks shelf, make the duplicate sheet to Line.

Rename sheet to "Line".



3. Now again I am going to make duplicate "Bar" sheet visualization.

From the Marks shelf, make the duplicate sheet to Area.

Rename sheet to "Area".



Now let's create parameters using following steps:


In the Data pane, click the drop-down arrow in the upper right corner and select Create Parameter.

  1. In the Create Parameter dialog box, complete the following steps:

  • Name the parameter so that viewers can tell what changes it will perform. This example uses Which Viz?

  • For Data type, select String.

  • For Allowable Values, select List, type Area as the first value in the list, and then press Enter.

  • Type Line and Bar the value in the list, and then press Enter.

  • Click OK .

Next, expose the parameter control so users can select the categories they want to display.


For each parameter you created, do the following:

  • Under Parameters, right-click the parameter and select Show Parameter Control

  • Test your parameters by selecting fields in the parameter controls

Below steps are to build the calculated fields that will take advantage of your parameters:


In the Data pane, click the drop-down arrow in the upper right corner and select Create Calculated Field.

  1. In the Calculated Field dialog box, for Name, type WhichViz.

  2. For Formula, build the calculation with just dragging parameter (Which Viz?) we created earlier

  3. Confirm that the status message indicates that the formula is valid, and then click OK.



To create filter, drag the created field (WhichViz) directly from the Data pane to Filters shelf.

When you add a field to the Filters shelf, the Filter dialog box opens so you can define the filter.

Use the General tab to select the values you want to include or exclude. Or,

select Custom value list and then enter the name of visualization (Area) you want to see.

Select Include all values then click OK.


Same process we are going to follow for Line sheet.

For create filter is to drag a created field (WhichViz) directly from the Data pane to Filters shelf.

When you add a field to the Filters shelf, the Filter dialog box opens so you can define the filter.

Use the General tab to select the values you want to include or exclude. Or,

select Custom value list and then enter the name of visualization (Line) you want to see.

Select Include all values then click OK.



Same process we are going to follow for Bar sheet.

For create filter is to drag a created field (WhichViz) directly from the Data pane to Filters shelf.

When you add a field to the Filters shelf, the Filter dialog box opens so you can define the filter.

Use the General tab to select the values you want to include or exclude. Or,

select Custom value list and then enter the name of visualization (Bar) you want to see.

Select Include all values then click OK.



Now we are going to create a Dashboard with these 3 visualizations.

Now, drag the visualization sheets you want in the dashboard. I am going to create a Dashboard with Bar, Area , and Line sheets.

Also make sure you select show parameter in Dashboard too.


Now in the dashboard, select the type of visualization (i.e., our parameter) you want to see.

I am going to pick Line visualization. It demonstrates how our parameter is swapping underlying sheets in the dashboard.


Here we can not see the visualization for Bar & Area but still we can see the titles so we are going to hide the titles. Just right click on titles and click on Hide Title.

Now in below image you can see the updated Dashboard without titles. At the same time I choose Bar visualization from parameter.


I am going to share the trick which is going to help you to see the entire area with one visualization. As you can see Line & Area visualization are not seen on Dashboard but that area is empty.

Following are steps for the trick which we can see full area visualization:


When you created Bar, Area & Line sheet at the same time create a dashboard.

So when you create a Dashboard first of all drag Horizontal from the Objects and drop it to Dashboard as you can see that in below image.


Now just drag & drop the 3 visualizations (Area, Bar, & Line) in dashboard.

Let's create a parameter (Which Viz?) and then create a calculated field (WhichViz) and put that field to Filters shelf so it is going to help our parameter to work.

Click Parameters (Which Viz?)drop down and select show parameter control to all 3 visualizations & dashboard.


As you can see, our trick works very well. Now we can see that our Bar visualization is rendered in entire area.




769 views0 comments

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page