6 Replies Latest reply on Oct 22, 2018 5:14 AM by Matthew Yandell-Thomas

    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.

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

                Hi Joe, thanks for your time in helping me with this. I've just taken a look at your provided workspace and you seem to have fixed my legend issue. I need to play around with that solution in my working file.


                However I'm still having an issue with the title.


                I previously asked a question on these forums about dynamic titles (which can be found here: Displaying a sheet title based on a filter ) and I'm using that solution here. However, in your new workspace the 'NDVI title here' text string still appears when I wasn't expecting it to. For example, if you were to select field JJ6 as below.


                In this draft of the data, it has no statistics and therefore does not plot a line chart. But the NDVI title appears whereas the Ratio title does not.


                On the NDVI Title sheet, I tried to replicate your suggestion. I added a pill into the Columns dimension with a constant value of A, as you had done for the NDVI sheet which plots the line chart. But the text string still appears along with an arrow bar beside it now.


                Is any reason why the NDVI title is behaving differently to the Ratio title? Seeing as one displays while the other does not. I hope this clarifies my issue. Thanks for your patience on this. My organisation is very new to Tableau and I'm currently the only user. Add to that we're only using it sporadically at the moment, so it doesn't feel like I'm using it to it's fullest potential or able to devote the time to get to grips with it fully what with my other duties within the company.

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

                  When I played with that a few days ago, I didn't have the workbook in full screen mode, and the dashboard was scrolled down just enough to hide the NDVI Title.  Even when I opened it today.  So I'm sitting here saying to myself, "What 'NDVI Title' ???"  That's why I said it behaves properly for me on 2018.3 in my last reply.


                  And then I notice the scroll bar.

                  Oops.  My bad.  There it is.


                  It took a little investigative work to figure this one out.  See NDVI Title (2).  I had to put some counts on there to figure it out.


                  On this sheet, the data source is "Fields".  There is a JJ6 row in that data source.  So Tableau dutifully displays the text stuff you told it to display.


                  I modified your original NDVI Title sheet.  I look to see if there are any rows in the Sheet1 data source that you use to generate the NDVI chart.  If not, set the value of the calc to null.  If so, then make the title you want.

                  See attached.

                  PS:  All the "A" stuff doesn't do anything here.  Save that in your bag of tricks.  Some day you might need it.  I go into some detail about using a bogus dimension like that in the "Miscellaneous" video I linked here:


                  New series of videos on swapping and popping on a dashboard


                  But today, it's not what you really need in your workbook.

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

                    Hi Joe. Thanks for that. I'll play around with it now to understand your solution.