Tableau Tip | Dynamic toggle between multiple parameters!

Tableau Tip | Dynamic toggle between multiple parameters!

When it comes to tableau, Parameters are so beautifully configured that it can be used anywhere anytime, within same or different data sources with multiple functions assigned. After the introduction of parameter actions the flow becomes so smooth that parameters can be used to trigger other parameters or even trigger itself and the best thing is multiple configuration of parameter action is possible from same parameter from same workbook and even from a single mark in the view.

Even though introduction of parameter actions is a game changer for me and my fellow Tableau developers, there are somethings which I personally felt difficult to achieve, something like dynamically toggle between two or multiple parameters in a dashboard.

Let me explain, Lets say I have a trend view which shows sales trend for the year. I have a parameter which toggle the views aggregation between Month and Quarter. So ideally my next parameter should be a parameter or a filter for selecting any month/quarter from view. There resides my problem! I cannot dynamically toggle between or combine my month and quarter parameter together. Both of the parameters needed to be physically exist in the dashboard even though I need not require them both at the same time.


No alt text provided for this image
The month parameter in the view is currently useless as it does not add any configuration change in the view


No alt text provided for this image
And here the same apply for Quarter parameter


This is one of the use cases I always encounter from client sides. So I am just sharing a workaround I usually use for these scenarios.

Since I am not a fan of hiding it with a sheet! and its not a practical solution for all scenarios, I am here recommending to create a Fake Parameter for this purpose!

No alt text provided for this image
One parameter here is fake and is dynamic! Surprised?

Yes! Fake Parameter! and I promise you will never even feel any difference, if formatted properly, like the image above!

No alt text provided for this image

Is that dimension filter toggled with a calculation? Nop its Pure parameter!

No alt text provided for this image

This is achieved by a couple of parameters and a bunch of parameter actions. Lets me give a walkthrough!


What you need?

  1. Select view Parameter - INT - Values (1-Month,2-Quarter)
  2. Month Parameter - INT - Values (1-Jan to 12-Dec)
  3. Quarter Parameter - INT - Values (1-Q1 to 4-Q4)
  4. Show/Hide Parameter - INT - Values (1-Show, 2-Hide)
  5. Suggestion sheet that dynamically changes suggestions
  6. Current value sheet
  7. Show suggestion indicator

What is the Plan?

We are going to simply combine month and quarter parameters together in a calculation and use that calculation to trigger the corresponding parameter

Calculations

1.Toggle Numbers - is calculation is used to trigger the corresponding parameter

No alt text provided for this image

2. Toggle Inverse - Used to toggle value within same parameter

No alt text provided for this image

3. Toggle Text - Used in the suggestion sheet to dynamically change suggestion values ie when month is selected in Select view parameter the suggestion will be months and for Quarter selected it will show Quarters

No alt text provided for this image
To exclude null value create a set for this calculation excluding null value

4.Show/Hide - To Hide the suggestion sheet when its not necessary

No alt text provided for this image
Just add Show/Hide parameter to a calculated field

5. Show/Hide Arrow - Icon for suggestion indicator

No alt text provided for this image
I use unicode for arrows

Thats all we needed!


The Fake Parameter!

Lets create the sheets required!

1) Suggestion sheet - Just add Toggle Text to rows and text, Add Toggle numbers in detail. Add an additional TRUE and FALSE to the details in order to cancel out the sheet highlighting (remember to add an action at the end)

Add required filters to your view as per your requirements

No alt text provided for this image
You either have months or Quarter based on your select view parameter value

2) Current Value sheet - Just add toggle text along with a filter for selected date filter (The end goal is just to show what is the current selected value in your parameter. so prepare you calculation based on your requirement)

No alt text provided for this image

3) Arrow indicator - Either use the show hide arrow calculation in shape or in label (as unicode arrows are used)

No alt text provided for this image

Alas! Done with the sheet.

Now build your dashboard with your required sheets.


Parameter Actions


No alt text provided for this image


Not as complicated as it seems. Just add the action to trigger the parameter from each sheet one by one

1) Show/Hide should be triggered from Current value sheet and Indicator sheet -

Target Parameter : Show/Hide Source field : Toggle Inverse

It will dynamically alter values for every selection. So alternatively click the suggestion box will open and close seamlessly

No alt text provided for this image

2) Suggestion sheet should trigger respective Month/Quarter parameter

Target Parameter: Month/Quarter Source field: Toggle Numbers

No alt text provided for this image

3) And finally suggestion sheet also close the sheet/hide

Target Parameter: Show/Hide Source field : Max(2) (Just add a MAX(2) in adhoc pain of suggestion sheet to trigger this action


And.... Its done!! Format properly and hide the suggestion sheet in the dashboard. All done!

No alt text provided for this image


I know this is a long blog! But worth all my time and effort! Attached link for the workbook.

Link: https://bit.ly/3yB1JSZ


Please reach out for any queries and advices. Share if you know any another method for the same scenario.

Regards!

Naomi Estrin

Innovative Visual Analytics Leader providing strategic data driven insight for business optimization

1y

Great post! Thank you for your hack. I'm using some of your technique here with one fake parameter along with an action filter that triggers from sheet A to sheet B. It seems rudimentary to set dynamic default choices for parameters, sets and filters without using parameter actions, filter actions or set actions.

Like
Reply
Jorge P.

Tableau Engineer, BI Analyst, #Tableau #SQL

1y

Thank you for sharing

Like
Reply
Mazeen Muhammed

Senior Data Analyst @ ADEK | Tableau, Certified Data Analyst | SQL | Python

2y

Great trick 👑

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics