Sheet Swap with Action Filters...the simple version!

Version 6

    Main Image - beforeAfter.png

    A few weeks ago I added a workbook library contribution, showing a trick for a sheet-swap using Action Filters


    Sheet Swapping using Dashboard Actions (...or the Illusion of a Full Outer Join on Blended Data)


    I think the actual trick itself may have been lost in my eagerness to talk about data Granularity...again! and was performed over blended data, adding a little more complexity!


    ...So here is the simple(r) version using a single datasource. I've found this trick increasingly useful, as it adds dynamism/flexibility to your dashboards without cluttering the screen with drop-downs.


    In the attached, I've created 2 sets of charts. One as Bars and the other Lines, and use a 'Shape' sheet, which toggles between the 2 views (as shown above).


    So first thing is to create 2 calculated fields. One I've called [1One] and is just the number '1'

    1One Formula.PNG

    and the other [0Zero] which is the number '0'. I then change these to dimensions.


    Next I create my 2 sets of Bar Charts (these are the worksheets, we want displayed when the 'Shape' hasn't been clicked - the default state of the dashboard). I set these up as usual...

    Bar View.PNG

    I've also added here a text worksheet, which will also 'swap' in and out, telling the user what to do. So for the 'default' bar views, I want the text to say 'Click Button to See Dashboards in Line Charts'...This will be in view when the Bar Charts are showing.

    Text Instruction.PNG

    So then we set up the line chart views. However, for each of these, we add our [1One] dimension to the detail shelf

    Line View with 1One.png

    Next we set up our selector. I've chosen a Shape, as I just want a single 'toggle' button, and this time we add the [0Zero] dimension to the detail shelf


    Next I bring in all my sheets to the dashboard. Using containers (as for a tradition, parameter based sheet-swap


    Now for the clever bit!...So we need to set up 2 Action Filters to get this to work. One to 'pass' [0Zero] to [1One] to , which has the affect of hiding the sheets and another to reverse this, on 'deselection'.


    So the first one we set up as follows (I've marked in Red the important parts). You'll notice that we've set the 'Selected Field' to pass [0Zero] to [1One] to all the Bar Chart sheets.

    Toggle Selector.png

    We then set up a second Action Filter to reverse this on deselection...ensure you have 'Exclude all values' ticked

    Toggle back.png

    In the attached, I've also set up a regular filter, to show you can still have all the usual, action filter, functionality for whatever set of sheets is in view.


    Hope you find this useful, and interested to hear any situations you use it in...Happy Swapping!


    You can also find this in my Tableau Public space

    Sheet Swap with Action Filters


    And the full description of how this works, can be found here

    Sheet Swapping using Dashboard Actions (or the Illusion of a Full Outer Join on Blended Data) | The Data Animators



    Edit SR (06/10/2016)

    I've attached a second example (swapping a map for a time-series), where I have commented (in the Captions) how to set up each sheet. I was also asked "how" this works. Below is a description on what's going on!


    So the key to this is the Actions. The first action is set up as per the below (which collapses/kills the Map worksheet when the "sheet swap" icon is clicked

    We are sending the Dimension 0Zero (0) from the "Swapper Icon" sheet, to 1One (1) on the Map sheet. This is basically sending it "Show me every row where 1 = 0"... and as 1 never equals 0, it has no rows to return and so collapses the sheet. Removing (or deselecting the filter) "Shows all values", so on de-selection, this filter is cleared, and the Map comes back.


    The other Action filter does the opposite. This is set from the "Swapper Icon" to the Trend Sheet.

    This one sends (from "Swapper Icon" sheet") the Dimension 0Zero (0) to the Trend sheet. Now 0 = 0 (and as we have created a dimension with Zero, every row in the data has the value zero), and the trend chart shows. This time, though we have, on de-selection, "Exclude all values". So this means when we un-click the "Swapper Icon" it excludes every row where 0=0, and so collapses the sheet.


    When you first set this up, you'll have both sheets in view, and it's only after clicking the "Swapper Icon" that it initiates the "Exclude". If you look at the sheets, you'll see a "Set" in the filter, which is how Tableau creates the actions.


    Tableau Version:9.0


    Further SR Edit (26/10/2016): Following up a question from Isa (see comments thread) I've added a 3rd example, where there are multiple selectors in play (things do get a little more complicated...but the principles are the same). I've added this one in, as this is my main use-case in my day-to-day job.