The great, worthy-of-worship Alan Smithee documented how to switch (show and hide) visualizations via parameters in this classic post (at least it’s a classic for me).
We can extend this idea to do the same thing with action filters. The goal is to show/hide a viz based on data selection…WITHOUT taking up real estate in the dashboard when the action filter is not activated. Click on one of the bars below to see what I’m talking about:
Here are the broad strokes of how to get there:
From what I’ve found, you’ll still need to lean on a parameter to get this done – even though you won’t show it to the user.
- Place the other worksheets that will share space with your “show/hide” object in the same vertical or horizontal layout container.
- Add a Blank object, as well. You can use this sucker to help push stuff around in the layout container.
- Create a Parameter of type List / String – Add values like “Show” and “Hide”. Set the default to “Show”
- Create a Calculated Field which returns the value of the Parameter you just created.
- Add this field to the Filter shelf of the viz you want to show and hide. When prompted, choose the “Show” value in the Filter dialog.
- Change the Default value of your Parameter to “Hide”. Your viz “disappears”.
- Add the viz to your dashboard on the opposite side of the Blank object (but still inside the layout container).
- Set the Parameter Value back to “Show”. The “hidden” viz now appears, and everything is compressed and messy. No worries.
- Now is a really good time to save your work.
- Resize the other vizzes and the Blank so you get whtat you think is a decent layout. DON’T touch the “show/hide” viz’s panel itself. It seems that if you resize this panel, we no longer will collapse it while in a hidden state.
- Remove your Blank and add the Action Filter. Make sure you use the Exclude all Values option.
And that’s about it. After you make your initial select / deselect, the viz should be hidden.