8 Replies Latest reply on May 8, 2018 9:01 AM by Joe Oppelt

    Hiding Sheets from Dashboard when Filter is selected

    Chris Breuner

      Hello! First off, I'm a big fan of Tableau and the hours its saved me coding. Currently I am having an issue that I have yet to find a solution for on the forums.

       

      I have been building out dashboards recently using two data sources. The first and largest data source is from our database, the second from a small CSV. The CSV file has data unrelated to that coming from the DB so the sheets themselves are all fairly simple. The dashboards all have to do with student statistics, and I have created action filters so people can filter by "major" or "college". This all works flawlessly however the few sheets that rely on the CSV data remain unaffected by these filters for obvious reasons.

       

      My question is: Is there a way to hide the sheets coming from the CSV file when any filter is selected? We would rather simply not show them than confuse people with the CSV sheets data remaining unchanged when a filter is applied. After searching for quite awhile I came across a post here that sort of does this the opposite way (Sheet is hidden UNTIL you click on a filter) and I have been trying to reverse engineer it to no avail. I have attached one of my sheets that shows this situation in action, as well as the sheet I found on the forums that shows/hides when a filter is selected.

       

      On the sheet attached below named "Enrollment Sheet-TEST" the sheet "Students From Under-Represented Groups" comes from a separate data source and is not affected by the filters on the dashboard. As you can see "Pell Eligible" and their statistics are simply floating text objects that I would need to hide on a filter select as well. What was asked of me what to simply make the "Students From Under-Represented Groups" sheet and the "Pell Eligible" image invisible/disappear when any filter is selected.

       

      Any help would be greatly appreciated, I have been trying to figure out a solution for quite some time now to no avail.

       

      Thanks in advance for your time, Cheers!

      -Chris

        • 2. Re: Hiding Sheets from Dashboard when Filter is selected
          Chris Breuner

          Thank you, I really appreciate your time! It's been stumping me for over a day now.

          • 3. Re: Hiding Sheets from Dashboard when Filter is selected
            Joe Oppelt

            (Note to self:  10.0 workbook)

             

            See the attached.

             

            Several steps.  First you want to determine if you have ALL or SOME.  Normally I determine what ALL should be with a FIXED LOD.

             

            This tells you how many Majors are in your database:

             

            { fixed : countd([MAJOR]) }

             

            There are 41 in your database.  (( added the value to the title of your sheet.)  Then you compare that number to the COUNTD of what's actually on your sheet.  If they match, your user selected ALL.  However, you have other filters in play.  Even when we have ALL/ALL for majors and college, the max shows up as 30.  What I really need to do is get a count of ALL/ALL within the context of the other filters.  And I started playing with moving those filters to CONTEXT in sheets 12 and 13.   And then I had a "eureka" moment.

             

            Your two filters are single select filters.  Therefore, if the user selects one, the [Majors -- Selected] value will be 1.  You'll either have 1, or whatever the max is.  Only those two values.  So you don't really need sheets 12 or 13 at all, and I just left them there to show my thought process.

             

            (If you will ever have multi-select filters, you'll need to determine what the max could be, and then compare the sheet's COUNTD to that.  If equal, then they have ALL.  If not, they have something less.)

             

            To figure out how many majors were selected, I cre4ated this calc:

             

            { exclude [ACADEMIC_TERM], [ACADEMIC_YEAR] :countd([MAJOR]) }

             

            This give me a COUNTD for the sheet.  The way your filters are set up, you'll either get a value of 1, or whatever the max could be, based on the other filters.

             

            (In the end, for the way this one is set up, you really don't need [Majors -- ALL] at all.)

             

            Look at Sheet 14.  This is the engine that will pop out a mask to hide what you need to hide.  Select something other than ALL for major.  you'll see that something displays in the sheet.  Select ALL, and the sheet goes blank.  We need this to "pop" out ablank container to hide what needs to be hidden.


            Look at Dashboard 2.  This demonstrates the "popping" technique.  there is a video about how to do this.  You'll find a link for it here:

             

            We made a video of Sheet Swapping and Legend/Fi... |Tableau Community

             

            On Dashboard 2 I have a container with two objects in it.  One is a colored container.  (Colored so you can see what it's doing.)  In front of it in the container is Sheet 14.  (I did HIDE HEADER for this sheet.)  Mess with the filter.  You'll see how the action of the sheet pushes the colored container back and forth.  this is what you'll use to hide things when you want them hidden.

             

            Go back to your Undergraduate dashboard.

             

            I floated the College Chart so that I can place things behind it.  (I floated its legend too.)  Actually, I ended up placing this sheet in a floating container so that I could color the container to make it opaque.  I noticed that when I select "Biology" for a major, the College Chart goes blank, but I needed it to hide half of my pop-out container.  So I placed the sheet in its own container, and colored the container white, and now if College Chart goes blank, I still have a white space hiding what's happening behind it.

             

            I built my pop-out container just like I did in Dashboard 2.  Now if the user selects a single major, the "masking" container pops out and hides the stuff in the lower right of the dashboard.

             

            (NOTE:  You'll want to do the same thing with a [College -- Selected] calc, just like [Major -- selected].  Then you'll modify [Pop out this sheet?] to look something like this:

             

            if attr([Majors -- Selected]) = 1

            or

            attr([College -- Selected]) = 1

            then 1 else 0 end

             

            Now the pop-out will happen if either one of them is not ALL.)

             

            So now we are hiding the stuff in the lower right of the dashboard if MAJOR <> ALL.

            1 of 1 people found this helpful
            • 4. Re: Hiding Sheets from Dashboard when Filter is selected
              Chris Breuner

              This worked like a charm. Thank you so much for all of your help. I appreciate it how you spent the time to lay it out step by step. I definitely just learned a whole lot from this as well as having the issue solved. I owe you a beer, Cheers.

              • 5. Re: Hiding Sheets from Dashboard when Filter is selected
                Bernardo Cordeiro

                Hello Joe Oppelt, I know it has been a while since you answered on this post bust I was wondering if you could elaborate a bit more on this part of your post:

                 

                (If you will ever have multi-select filters, you'll need to determine what the max could be, and then compare the sheet's COUNTD to that. If equal, then they have ALL. If not, they have something less.)

                 

                I've done some tests and I know what my MAX is but I can't seem to get it working a multi-select filter.

                 

                KR
                Bernardo

                • 6. Re: Hiding Sheets from Dashboard when Filter is selected
                  Joe Oppelt

                  Bernardo -- I think this question should be a new thread.  Upload a sample workbook with that new thread.

                   

                  It's going to depend on how things are set up on your sheet.

                  • 7. Re: Hiding Sheets from Dashboard when Filter is selected
                    Bernardo Cordeiro

                    Unfortunately I cannot publish my workbook, as such I will try and do something with how you explained everything there. Thank you for this wonderful post!

                    • 8. Re: Hiding Sheets from Dashboard when Filter is selected
                      Joe Oppelt

                      Anonymize your Tableau Package Data for Sharing

                       

                      I don't need your exact workbook.  Just hack up something similar to what you are doing.  Check out the video in the link.  It's pretty easy to do.