Tuesday, April 21, 2020

Deselecting/De-dimming Buttons in Action-Driven Sheet Swap

Video Tutorials
How to create Sheet Swap via Parameter Action
https://www.youtube.com/watch?v=XERIMcLcSVc
How to De-Select Buttons in Tableau Dashboard
https://www.youtube.com/watch?v=G7fEt0H6LiY

A colleague ran into a little problem: He created an action-driven sheet swap dashboard, where he has two buttons. Clicking one button will show one sheet and clicking the other button will show another sheet. However one button remains selected even after clicking the other one. This is annoying. BTW, Tableau Zen Master Joshua Milligan provided a solution for deselecting navigation buttons long time ago. Kind of a oft-met UI issue.

Based on an approach originally proposed by Yuri Val, I am going to create a simple example of parameter action-driven sheet swap with button deselection as well as button de-dim.

First let's create a simple table with one column and two rows:
  • Sheet
  • 1
  • 2
We name this table as Button and import it into Tableau as a data source. Then we create a worksheet with two buttons.

Before selecting a button
After selecting a button, the other will become dimmed.
What we expect to have is, after a button is clicked, it is deselected right away instead of staying selected. And the other button is de-dimmed in the mean time.

Using Yuri's approach we created two calculated fields True and False with content the same as the name True and False respectively.
Then let's create the sheet swap mechanism, given that we have created two charts (from two different data sources).

- Create a parameter Sheet Select with two values 1 and 2.
- Create sheet filters Sheet1 and Sheet2 in respective data sources:
  • Sheet Select =1
and 
  • Sheet Select = 2
and place them in their respective chart filter shelf.
- Create a container and drop the two sheets into it.

Last, set up two dashboard actions in dashboard as follows:
- Parameter action that drives the sheet selection
- Filter action that deselects/de-dims button
Feel free to download the workbook for practice and for learning more about sheet swap and button deselection/de-dimming.

The above approach can be applied to more than two sheets swapping. In case of N>2 sheets, we need to have a N-value parameter, assigning one value to the filter of each of the N sheets.

3 comments:

  1. Many thanks Alexander for your tutorial on youtube. I could make a lot of use out of it as I have this one dashboard that will be embedded in a portal and accessed via trusted tickets. It means that all has to happen on one dashboard.
    I came across a little problem because I have two different filter sections applicable to two different KPIs. I made it explicit where to set the filters with a little indicator (custom shape) that will be either filtered out or visible depending on the same filter actions as the parameter sheet swap.

    ReplyDelete
  2. Thanks it helped me alot your blog. keep it up wala

    ReplyDelete
  3. Thanks it helped me alot your blog. keep it up wala

    ReplyDelete