0 votes
1 view
in BI by (41.2k points)

I have a dashboard with three displayed parameters:

  1. Time range (Last month, This month, Last 30 days, ..., custom interval)
  2. From (the begin date of the interval)
  3. To (ending date of interval)

My point is that I want to display "From" and "To" parameters only in case when "Time range" parameter is equal to "Custom interval".

Otherwise, I want to hide them or make them impossible to edit.

Could you help me with this, please?

Thanks.

1 Answer

0 votes
by (15.1k points)

  • There are a handful of techniques for selectively hiding components on a dashboard, informally called "sheet swapping".

  • One simple approach is to place a floating worksheet in a layer above the components you wish to hide -- and make that worksheet have filters based on calculated fields that lead to zero rows or columns being displayed when you wish to show the components below. Then if you hide the title on the worksheet, it will display as zero pixels high or as its complete height depending on the parameter settings.

  • Here is an example of that approach https://public.tableau.com/en-us/s/gallery/music-uk

  • Another form of sheet swapping that gives you a little more flexibility is to place the components that wish to selectively display inside a layout container along with a component whose size depends on the parameter setting. Then you can adjust the "fit" options for the worksheets and where and how you place the layout container to make the optional controls slide in and out of the dashboard or out from under a floating component or slide beneath or Here is a workbook demonstrating some of these techniques http://public.tableau.com/views/SheetSwappingonSteroids/PracticalExample and he also describes them in his (highly recommended) book Learning Tableau 10

  • Here is another blog entry showing some fancier sheet swapping techniques https://www.tableau.com/about/blog/2016/1/how-create-collapsible-menu-container-tableau-48610

  • Note, sheet swapping puts a bit of unnecessary load on the Tableau server if overdone (computing layout positions for views that won't be displayed anyway).

  • If you don't mind a bit of coding, another option is to embed your visualizations within an HTML page of your own design. Then you can use all the power of HTML and CSS to style parts of your UI - including hiding and showing input controls. Then write a bit of JavaScript using Tableau's JavaScript API to let Tableau know when someone updates an HTML control so it can update the visualization in response. For a really robust complex page, that might be a better choice than trying to emulate HTML/CSS with sheet swapping techniques in a Tableau workbook.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...