5 Replies Latest reply on Nov 14, 2012 9:28 AM by Chris Tsui

    Relevant Values in Legends

    Chris Tsui

      Hi All,

       

      Not sure if this is a simple item, but is there a setting (similar to in the quick filters) where you can have legends only show relevant values?

      (Can't really put a sample up given data security) 

       

      I've created a map,

      Put a year pill in the Pages Card    

      And a pie chart mark for each city showing Quantity amongst providers

      I noticed that as I "Slide" between years with the page slider, the Legend remains the same with all the names of the providers available

       

      I know that If i set the year as a filter and filter through the years the legend changes dynamically based on what providers were there that year (and my pie chart updates accordingly)

       

      Is there a way to either set the legend to filter its values based on the year pill in the Pages card? or have a filter "dynamically filter?" based on what is in the pages?

       

      I'm not sure if this makes sense so feel free to poke and prod for more details If at all possible!

       

      any help would be greatly appreciated!

        • 1. Re: Relevant Values in Legends
          Shawn Wallwork

          Chris, I suggest you use the Super Store data set to mock up your situation. Then I'll be happy to take a look. (Also, don't forget to post a packaged workbook.)

           

          --Shawn

          • 2. Re: Relevant Values in Legends
            Chris Tsui

            Hi Shawn,

             

            Sorry for the delay, it was a long weekend here in Canada

             

            Thanks for the suggestion. 

             

            I think I've mocked up what I have been trying to explain.  I had to "modify" the Super Store data to represent my situation.  What I did in the Datasource was:

            In the Order Year of 2010, In the State of Washington, I changed two "Auburn" Customer City entries to Anacortes  (I did this to show that in the year 2010 there were not Customers in Auburn that had an order.)

             

            In Tableau I Created a map and used the City Pill

            I filtered for Washington State

            I put the order date on the pages shelf

             

            What I was hoping for was that when I "slid" the year to 2010, the city Legend would remove Auburn as a legend entry.  (Clicking on Auburn when the slider is in 2010 greys out all cities and none are highlighted)

             

            The Behaviour I'm looking for, is similar to when I craeted a quick filter on Order date.  If I select ONLY the 2010 entry, the Auburn Legend entry disappears.

             

            Perhaps I don't have a full understanding of the pages shelf and am trying to use it as a "psuedo" filter when it shouldn't be. 

             

            Any help you could provide would be greatly appreciated!

             

            I have attached the workbook I used.

            • 3. Re: Relevant Values in Legends
              Shawn Wallwork

              Chris, I played around with this a bit to see if there was a way of 'tricking' Tableau into 'filtering' your color legend as you page through the years. I didn't come up with anything, but maybe Richard can come up with some way to do this. Sorry I couldn't help.

               

              --Shawn

              1 of 1 people found this helpful
              • 4. Re: Relevant Values in Legends
                Jonathan Drummey

                I was playing with just this issue last week while trying to make Hans Rosling-style exploding scatter plots.

                 

                When you put something on the Pages Shelf, Tableau effectively renders the entire view and lays out all the headers, legends, etc. that are needed at any point in the view. The advantage of doing all the rendering at the beginning is that Tableau then can do animation, mark trails, etc., and I imagine the Tableau developers decided to make life simpler by not adjusting the legends to the displayed marks. The computations that Tableau does based on the Pages Shelf are at the end of the pipeline, or close enough that the effect is the same - there's no access to calculated fields to know which particular combination of discrete values is being displayed on the Shelf. The only option I know of to get the legend to update is to use a parameter and a calculated field to filter, I set that up in the attached. The downside is that you lose the mark trails & animation.

                 

                Jonathan

                • 5. Re: Relevant Values in Legends
                  Chris Tsui

                  Thanks Jonathan! 

                   

                  I am going to incorporate your method into my project and see if I can get the desired report!

                   

                  Understand about how Tableau computes.  Brings me back to using Crystal and having to get my head around the different runs it needed to "print" records

                   

                  Now onto the next thing that I will end up banging my head against and having to come back and post here!!

                   

                  Thanks again!

                  Chris