3 Replies Latest reply on Oct 15, 2018 8:38 AM by Joe Oppelt

    Filter Action not behaving as expected - other solutions?

    Matthew Yandell-Thomas



      I'm using Tableau 2018.2.2 working with a spatial dataset and some tables. When clicking on a polygon in the map window, I would like some charts to appear giving information on the polygon that was selected. I have already set up some filters to do this but it's not behaving as expected in all cases. Any advice to get back on track, or some alternative suggestions would be appreciated.


      Here is my WiP dashboard as things stand:


      I have my map on the left and some weather information on the bottom right.


      When I select a polygon on the map, the filters begin to kick in:



      Two line charts appear, giving more information on the polygon, appear along with a legend (detailing the polygon ID). The default titles for each chart from the sheet themselves are hidden, otherwise I found the title would always be displayed. I got around this by creating a new sheet and populating the Text field in the Marks pane with my title. This is behaving as intended.


      However there are some instances where a polygon may be missing data for one or both charts:


      In this example, the lower chart appears but not the top chart nor the legend. I believe the legend is linked to the top chart and is therefore not displaying as there is no data available. However the title for the top chart still appears which I would rather not display.


      In this example, there is no data for either chart but the title for the top chart appears (bad) but the title for the bottom chart does not (good). Again there is no legend either.


      Here is my filter rules:



      Going back to the legend. Instead of using the legend from the top chart, I added the legend for the map sheet but it displays like this:



      As you can see it displays all the polygon IDs as 'blank' boxes regardless of selection.


      To style the polygons, I'm using a dual axis on the map sheet. One has the polygon IDs dropped on the colour mark while the other displays the polygons as a single colour. On selection, the unique colour displays.


      My questions are:

      Can anyone explain why the top title appears at all times apart from when no polygons are selected?


      As an alternative solution. Is there a way to display an empty chart if there is no data available for a selected polygon? That way the empty chart and titles can display at all times and be populated with data on selection.


      Is it possible to have the legend displaying the selected polygon with the correct colour, regardless of whether or not there is supplementing data, on selection?


      Thanks very reading.



        • 1. Re: Filter Action not behaving as expected - other solutions?
          Joe Oppelt

          You're not getting a lot of activity on this question because it really needs a sample workbook.  At least for me, all that description requires me to juggle too many factors to keep things straight in my head.


          You can anonymize a subset of your data as shown in the video linked in this thread:



          Video demonstrates how to anonymize your workbook/data


          I kind of pride myself on doing actions and making things pop out or hide, so I really want to take a shot at your example, but I need something concrete to play with.

          • 2. Re: Filter Action not behaving as expected - other solutions?
            Matthew Yandell-Thomas

            Hi Joe,


            I've just attached a package workspace.





            • 3. Re: Filter Action not behaving as expected - other solutions?
              Joe Oppelt

              Here are some things I see.


              First of all, I'm using 2018.3 (which allows me to save it as 2018.2 for you.)  When I click on one of the polygons you highlighted, the sheets behave as I would expect (no display), and not as you describe.


              However, I know for sheet swapping, (which you're not exactly doing, but some of the same principles apply), to get the sheet to release its assigned space when it should disappear, there needs to be at least on dimension on either rows or columns.  In the attached, for NDVI and Ratio, I added a bogus dimension, and then I right clicked the pill and unchecked "show header".  (When you first add the dimension, you get labels and values, of course, but taking off "show header" hides that.)  Given that the calc is a constant, it doesn't affect any behaviors on your sheet.

              See how this behaves on 2018.2 for you.


              Regarding legends, I misunderstood your question at first, which is why I floated your legends and changed the directional arrangement of them.  Ignore all that.


              The legend for the top sheet displays as it does because you have set opacity on COLORS to zero.  So you get all blue polygons.  There are two things you can do.  I created a second copy of your sheet and returned the opacity to 100.  Then I added THAT sheet and used its legend.  I floated that sheet, sized its coordinates to 1,1,1,1 (X/Y position is 1 -- upper left corner of your dashboard, and size = 1, so nobody sees it.


              However you can also do this:  On your original sheet 1, return the opacity setting to 100.  You'll get all colors.  But then drag the order of the two longitude pills on columns so that they are flipped in order.  This puts the colored axis behind the blue axis, and you'll just see the blue polygons.