4 Replies Latest reply on Aug 12, 2013 9:31 PM by Jonathan Drummey

    Multiple filter controlling on one column

    Haitao Wu

      Hi All,

      I have a scenario with filters where we want to build 2 filters actually based on the same columns but let them be an "OR" relationship.


      Suppose here is the structure:


      Column A      Column B      Column C

      iOS                iOS_Games      10          

      iOS                iOS_Overall      20     

      GP                GP_Games      15     

      GP                GP_Overall      30          


      We want to build 2 filters base on column B that in one filter (we call iOS filter) it shows ("iOS_Games", "iOS_Overall") and in the other (we call GP filter) it shows (GP_Games, GP_Overall). Then if we choose in iOS filter "iOS_Games" and choose in GP filter "GP_Games", we want column C are aggregated as 25.


      We don't want only one filter for people to choose all 4 elements. Because people might choose "iOS_Games" and "iOS_Overall" at the same time and this could produce errors since the table we have are aggregation tables and there would be duplications between the numbers (Column C) in iOS_Games and iOS_Overall for column B. We also don't want to set the filter to be single choice because in that case people might not be able to add iOS_Games and iOS_Overall.


      Does anyone have any idea how to achieve this?

      Thanks for your time and efforts in advance.



        • 1. Re: Multiple filter controlling on one column
          Mark Holtz

          Hi Robin,


          This can generally be achieved with one or more parameters coupled with one or more calculated fields. Can you attach a packaged workbook? See Shawn Wallwork's advice on getting a satisfactory answer to your forum question on his article: So Your Question Didn't Get Answered....


          In the meantime, this might help spur your creative juices regarding what you can do with parameters: Using Parameters | Tableau Software

          • 2. Re: Multiple filter controlling on one column
            Shawn Wallwork

            Mark thanks for referring folks to the So your Question.... guide. Just wanted to mention this is a group effort. I posted the original but many others have edited and added to it, notably Jonathan, Andy, Josh and others. You're also welcome edit/add to it if you have other tips.





            • 3. Re: Multiple filter controlling on one column
              Haitao Wu

              Thanks for the reply Mark!


              Actually I am wondering if there is another way other than using parameter to achieve this. We have a lot of data and we would have a lot of elements in the parameter - not easy to maintain and I believe by using parameter, the performance might be degraded. Also we have a lot of users and for each of them, what's shown in the parameter filter (if I understand you correctly: your suggestion is to put this parameter as a filter) differs. This is not ideal to us.


              Please do let me know if I misunderstand you. Unfortunately I am afraid for now I would not want to distribute our workbook. But I would try to make a sample later.


              Any other ideas?

              • 4. Re: Re: Multiple filter controlling on one column
                Jonathan Drummey

                I set up a couple of options in the attached. Tableau isn't by nature set up to do an OR filter, so the only thing I could come up with that fakes an OR filter is a hack using separate secondary data sources to filter the primary, while keeping a Null filter selected. This is the "data blend for OR filter" worksheet, and is not really workable, I put it together more as a conceptual work.


                There is an alternative, though, and that's to go back to your original data that is coming in with the pre-aggregations. Rather than trying to limit the filter options, how about making the computations smart enough to ignore including the pre-aggregated _Overall totals when a user has selected other values? I set an example up in the attached that uses a nested table calculation to flag whether there are detail rows selected, and if so, the _Overall row for that column A is not included in the sum of C. Because you didn't provide a packaged workbook with sample data or more detail on the desired view, I had to make some guesses, if this seems like it could meet your needs and you need more help please mock something up, thanks!



                1 of 1 people found this helpful