7 Replies Latest reply on Aug 29, 2014 6:12 AM by Matt Lutton

    Why does my filter break?

    Peter Tram

      I have a 3 level hierarchy with Parent>Child1>Child2 that I use in a table with Sales #'s. So there are 3 parents, each has 10 child1's, and each child1 has 30 or so child2's. The table allows me to drill up and drill down through the hierarchy. I have a slider on the side that lets me rank Child1 and Child2 and choose which ones to show, for example, I can select 1-5 and show only the top 5 of Child and when I drill up to Child2 only the Top5 (by sales) show as well.

       

      The problem is that when I drill up to Parent, the furthest level out, my calculated field for the rank in my filter shelf turns red and breaks. The entire view becomes washed out and does not allow any interaction. It is really important that users can drill up to the Parent level. Does anyone know how to prevent my hierarchy from breaking my rank filter?

       

      Thanks

       

      Message was edited by: Peter Tram

        • 1. Re: Why does my filter break?
          Tracy Rodgers

          Hi Peter,

           

          Welcome to the forums!This is probably because the way that the calculation is being computed is based on Child1. Would you be able to post the workbook (twbx file)?

           

          -Tracy

          1 of 1 people found this helpful
          • 2. Re: Why does my filter break?
            Peter Tram

            Hello Tracy,

             

            Thank you for helping with this. I just attached the workbook to my main post. On the "Drilling Works" worksheet, if you roll up from Drug to HCP and then to Hospital, the graph breaks and my calculated measure turns red. I can roll up from HCP to Drug, but not from Drug to Hospital.

            • 3. Re: Why does my filter break?
              Shawn Wallwork

              Peter, it's one of those Tableau quirks. When trying to use a table calculation (index) you are addressing on HCP. So that field has to be in the view. When you drill up to hospital you are taking HCP out of the view. That's why the calc breaks.

               

              addtessing.png

               

              You can use a Top X parameter to let your user filter, and get rid of that table calculation. See attached.

               

              --Shawn

              1 of 1 people found this helpful
              • 4. Re: Why does my filter break?
                Peter Tram

                Hello Shawn

                Thank you for your response. I'm having trouble opening your workbooks because I am currently using Tableau 8.1 and I think yours were made in version 8.2. Could you elaborate more on the top x parameter?

                 

                I was playing around with creating a parameter for a Top N filter. I created a parameter, set it to Integer, gave it current value and automatic display format, fixed range, and min and max. Then I moved my HCP and Hospital dimensions into Filter, and made the filter type Top [Parameter] by units sum. I can remove my calculation and show the parameter control, and my viz no longer breaks. However, the problem I now encounter is that the parameter doesn't adapt.

                 

                I think it is just showing the Top N HCPs. So when I drill up or drill down, it is based on that. I would like it to respond so that when I am drilled out to the Hospital level, my slider is on the range 1-3, so I can show the top 1, 2, or 3 hospitals. When I am drilled in to HCP or Drug, I want to have the parameter control slider show 1-32. And with the calculation I had, it would show the top 5 HCPs for each hospital. Now I just get the overall top N, regardless of hospital.

                 

                Forgive me if your workbook addressed these issues, with Tableau 8.1 preventing me from opening it, I was trying to figure out how to apply a parameter to meet the specific needs detailed above.

                 

                Thank you

                Peter

                • 5. Re: Why does my filter break?
                  Shawn Wallwork

                  Peter I was looking at the wrong sheet. Take that 'correct' off because the solution I posted wasn't solving your problem. At this point, I don't have a solution for you. This is a classic example of why I rarely use hierarchies -- they break table calculations. Maybe some else has this one solved and is willing to share.

                   

                  Cheers,

                   

                  --Shawn

                  1 of 1 people found this helpful
                  • 6. Re: Why does my filter break?
                    Peter Tram

                    Okay, thank you Shawn. If anyone else has had this problem and found a work around I look forward to hearing your solution!

                     

                    -Peter

                    • 7. Re: Why does my filter break?
                      Matt Lutton

                      Placing HCP on a shelf to force it to remain in the view will make the filter "not break", as Shawn mentioned.  The calculation will not provide the results you want at various levels and I do not know of any way to have the Table Calculation dynamically adjust based on the Hierarchy level you've chosen.

                       

                      What I might suggest is creating a parameter that allows the user to choose the level they want to view -- you could use the sheet swapping method to allow them to view different sheets that are set at different levels

                      Sheet Selection on Steroids | VizPainter

                       

                      Someone else may have a better idea, but I hope this helps.