Using Parameters in Histograms
Data Analytics

Using Parameters in Histograms

Generally a parameter is a workbook variable such as a number, date, or string that can be used to replace a constant value in a calculation, filter, or reference line.

For example, there may be a requirement where one end user wants the Sales to be displayed in a particular visual while another end user wants Profit to be displayed in the same visual. This can be achieved by using Parameters. Hence parameters are used to give more control to the end user.

Although Parameters are very powerful and have a wide range of uses in Tableau, I would like to mention very a useful and practical application. It is for the dynamic control of the Bin Sizes in Histograms.

Original Situation:

Consider a Histogram that provides the distribution of Age. It will have a default Bin Size and in case we need to change the Bin Size it has to be done manually using the Edit --> Size of bins option

 

 

 

 

 

 

 

Problem Statement:

This process of manually changing the Bin Size can become very difficult and tedious in case the end user needs it to be changed constantly maybe as part of an Exploratory Data Analysis process.

Recommended Solution:

We can make use of a Parameter that can be changed dynamically by the end user

Given below are the typical steps with respect to creating and using Parameters

Step 1: Create a Parameter

 

 

 

 

NOTE: This is just a reference for creating Parameters. The actual selection criteria may vary based on the actual use case.

 

Step 2: Show the Parameter

 


Step 3: Link the Parameter to Bin Size

 

 

Now the Bin Size can be changed dynamically.

Given below are three examples of bin size selection to confirm that the histogram plot changes for each bin size

Bin Size 1:


 

Bin Size 2:

 

 

Bin Size 3:

 

I hope this tip regarding the usage of Parameters was useful.

DISCLAIMER:

This article is not meant to be a Tableau tutorial so the steps may vary based on the actual use case or application. The intent of this article was to create the awareness of how easy it is to use parameters for one particular application.

REFERENCES:

https://help.tableau.com/current/pro/desktop/en-us/parameters_create.htm

 

  • Deepak Holla
  • Jun, 18 2022

Add New Comments

Please login in order to make a comment.

Recent Comments

Be the first to start engaging with the bis blog.