Skip to main content

@Ken Flerlage​ 

 

Following you OUTSTANDING advice, I was able to create multiple interactive bar charts.

Clicking functions as a TOGGLE, where one click turned the element on, a second click turns it off. See the details and stunning explanation here:

 

https://community.tableau.com/s/question/0D78b000008Y2Q5CAK/detail?s1oid=00D4T000000Dj8G&t=1653926048899&s1nid=0DB4T000000GnPK&emkind=chatterCommentNotification&s1uid=0054T000001O4m9&emtm=1653925990894&fromEmail=1&s1ext=0

 

My question: How can I create a user button that will ACTIVATE all items in the bar chart?

 

For example, suppose a user has whittled away at a dimension, leaving only 1 of the 100 elements active. We don't want our user to make 99 clicks to get them all back.

Can the elements be turned back on with a single click?

 

Note that fully ERASING all elements is simple: just make an action that will populate the selected string with null.

 

It seems, by corollary, we could get them to all turn on if we populate the select string with a concatenation of all values (on or off)... but I'm unsure how to create this string dynamically. Help?

3 respostas
  1. 30 de mai. de 2022, 16:19

    To do this, we need to create a list of of all the values then force those into the parameter. To do that, I'd use a trick by @Jonathan Drummey​ to create a comma-separated list, as detailed in the following workbook: https://public.tableau.com/app/profile/jonathan.drummey/viz/TheNextNTableCalculations/15_MakingaStringList

     

    We need two calculated fields:

     

    Region List Feeder

    // All regions in a list.

    IF FIRST()==0 THEN

    MIN([Level 1 Item])

    ELSEIF MIN([Level 1 Item]) != LOOKUP(MIN([Level 1 Item]),-1) THEN

    PREVIOUS_VALUE("") + MIN([Level 1 Item])

    ELSE

    PREVIOUS_VALUE("")

    END

     

    Region List

    // Single field with full list of regions.

    PREVIOUS_VALUE(LOOKUP([Region List Feeder],LAST()))

     

    Add these both to a sheet. Then use the LAST=0 trick to filter down to just the last row (technically speaking, we could just use the first calculated field for this since the last row will have all the items). Then change the mark type to shape and add a button image.

     

    To do this, we need to create a list of of all the values then force those into the parameter. 

    Now hide the headers for both pills and increase the size.

     

    image 

    Add the button to your dashboard, then create a parameter action:

     

    image 

    When you click that button, it will write that full list into the parameter, essentially turning "on" everything. See attached.

     

    Note: Clearing all items would be simpler because you could just feed "" into the parameter.

0/9000