How to Use Tableau’s Parameter Actions Extension to Change Date Parts

16 views Comments last seen 2018/12/11 02:36:32am Tableau

One of the features which are in Tableau is 2018.3 is Parameter Actions. This feature not only unlocks a lot much of flexibility but also provides a better opportunity to design your user experiences and to transfer control of analysis from oneself to the other end user.

In this blog, I will share a way to improve the user's experience on a line graph by visualizing and permitting the user to opt which granularity. Post, we will make that user experience better by using Tableau's Actions Extension. The dashboard extension will allow the user to create a seamless, web-like experience that allows our end users to change a date part by clicking on a letter!

How to Use Tableau's Parameter Actions Extension to Change the Date Parts?

Below is the line graph for the sample- Superstore dataset that I chose today.


This graph is hard to compare the performance of each day. To make it understandable, I can change the granularity of the date, from days to months.


It is the entire dataset of four years. Now I will zoom and take a look at just a single month of the data

Since my date part is the month, Hence there is only one month in the view. I have the flexibility to display my date part granularity. The user can drill down and back to up in Tableau when the fields when the fields are a part of the hierarchy, including dates, by hovering over the axis and clicking the plus sign to drill down more granularity date parts or minus sign to drill back fewer granularity parts.



The drill-down capability is very subtle, and it depends on the audience that I am targeting for, they are unaware of this feature existence. If there is more than one line graph, the user has to change the date part for every chart targetting. Here are the simple two-steps tactics to provide the user experience more intuitively.
1) set up a parameter with "String" data type and content of allowable values. The permissible values will be the date parts that you want your end users to choose. We will eventually allow the end user to decide to look at the line graph by any granularity. We can display the values in whichever case we prefer. Here's the look of the parameter:

2) Set up a calculated field that truncates the date at whichever value we select in the Parameter from step one: Below is the formula that we will use:


If the original order dsate gets replaced with the newly created one, the date will be truncated. It would be critical to choose Date when using its calculated version regardless of whichever Granularity is released.


The first value which is allowed in a parameter becomes the current value — this the reason why the line graph broke when I had replaced Order Date with Date Granularity. Let me show the parameter control from the Data Granularity by right-clicking on the parameter ---> Show Parameter control. The end user can decide how he wants to truncate the dates.
Here is how the Chart looks:


Using Tableau's Parameter Actions extension to control the data parts.
The tactic which I have described, till now is something that I have been using. We can make it better with Dashboard Extensions (new feature in Tableau 2018.3). It allows Tableau along with the third-party developers to take the core step further. In this situation, we use the dashboard extensions to create a user-friendly, experience which allows the users to change the date part in the Line graph. You can save these extensions wherever you would like. I recommend people to use Tableau repository or your program files.
Instead of using a drop-down menu to change the date part, we will allow them to change the date granularity by clicking on letters which represent the date parts
1) The first procedure is to build a control sheet with the "buttons" in which our end user will click. To do this, we will connect this to the other data source that includes two columns: a) Button and the b) Value. Post which, we will make a text table where my user will click.


I have placed the Value field on the Detail Mark Card. This field contains the words with different granularity. It's critical to have those values on the view because they will be needed so that we can populate the Date with the Granularity calculation.

We will consider one more point. You should have your date granularity parameter to have the allowable values.
Earlier we set this with a list of specific permissible values of All. It will permit the current value of the parameter with any word selected in the control sheet.


We will create an experienced user dashboard. Place both, the line graph and the control sheet on a new Dashboard. Also, remove the date filter from the line graph so that we can display all the dates in the Sample- Superstore dataset.

After placing the Parameter Actions extension onto the view, the configuration options will open. It is an intuitive interface. I have told the Extension that I will use the Date Granularity parameter, The Value field has to populate the current value of the Parameter and the selection which originates on the Control sheet.

If I click M in the control sheet, the month date granularity populates the calculated field which truncates the dates.

If I click on Y, its truncated by Year.


The surrounding White space is taking up way too much room on the dashboard. To hide this, select the extension object by clicking the down arrow and click Floating.


Click the layout pane, and change its dimension to 1 by 1 pixel.


It makes the object invisible. We can find the purpose if you want to change the configuration. Click on the Layout pane and click the name of the object at the bottom of Pane.
Here is my final view after choosing the date part granularity:


The end user can now control the level of granularity of the line graph by clicking a letter from the control sheet.

If you need to understand the complete picture of the data, and to get to know the complete working of Tableau, enroll yourself for Tableau Training program at PST Analytics, Gurgaon. We have super knowledgeable professional tutors who will train you in the field of Analytics, Data Science, Machine Learning, Artificial Intelligence, and Data Visualization. The trainers themselves are associated in their respective domain and are globally certified.

Good Luck Endeavors!!

Comments