7 Replies Latest reply on Aug 29, 2016 2:31 PM by Yuriy Fal

    Multiple Filters with AND Conditions

    Dan Quigg

      I am still fairly new to Tableau and struggling to do something I think is pretty basic. I have one column in my database that has a list of dimension values that vary based on another column called Series. So I created a series of calculated columns that vary based on the result in Series. If it does not apply, I insert a NULL value. So far so good and I get the results I want. My database with the calculated columns looks like the one below.


      Tableau Database Example.JPG


      The problem is I want to be able to group the Enrollment measure (there is only one measure) by the combination of the four columns (Size and Setting, Enrollment Profile, Affiliation, and Basic Classification). I can only seem to be able to use one filter at a time rather than all filters. I tried using filters in context but don't get what I want. I need to be able to collapse the results by all selected filters to get the Enrollment Value above.


      Thank you very much!!

        • 1. Re: Multiple Filters with AND Conditions
          Dmitry Chirkov

          Wait, are you saying you can't put ALL the filters you want on the filter shelf?

          All the filters there are AND'ed

          • 2. Re: Multiple Filters with AND Conditions
            Dan Quigg

            No sorry I was unclear.  The problem is with deploying them as selectable using Show Filters. As soon as you select an option, the other options are immediately limited to the NULL values because it applies the Show filter selection immediately.  I want to effectively group all of the filtered selections and apply it at the end.

            • 3. Re: Multiple Filters with AND Conditions
              Dmitry Chirkov

              It's still not super clear what you mean, sorry. I guess we use different terminology.


              If I understand correctly though - you want to set values for several filters and only then let it recompute the dashboard, correct? If yes - there's this option to make dashboard updates manual:

              If not - show a picture

              • 4. Re: Multiple Filters with AND Conditions
                Dan Quigg

                Dmitry, yes you are correct.  I want to use show filters but have it apply as independent selections and then refresh the worksheet when all are applied. The problem is that the columns are calculated fields and they each are calculated based on the same original data column.  So what happens is I can only select one filter at a time and not in combination because the filter reduces the other options to just null.  See the above data source table.  Only one of the calculated fields applies at a time. My worksheet looks like the following.  If I pick Affiliation for example, the only options are NULL values from the other calculated fields. What I really want is to group by the combination of ALL of the calculated columns. I hope this makes sense.


                • 5. Re: Multiple Filters with AND Conditions
                  Dmitry Chirkov

                  Roger Hau, does Don here need a pivot or something?

                  • 6. Re: Multiple Filters with AND Conditions
                    Dan Quigg

                    The database is an Access database so I don't think pivot applies.  Our software creates a Primary_ValueEnum table that can contain multiple types of data based on something called the Series ID.  I created calculated fields that separate out this data based on the Series ID. If the column does not apply, then I fill it with NULL. This works great except when I want the user to select the filter. When I put each calculated column in as a filter, it wants to recalc the view each time. What I really want is the combination of the three calculated columns to then restrict the entities which appear. I tried using parameters as well.  My best guess is I need to restrict the entity based on some combination of the three calculated fields as parameters. 


                    I am looking also at ways to restructure the database to make this work more efficiently.

                    • 7. Re: Multiple Filters with AND Conditions
                      Yuriy Fal

                      Hi Dan,


                      Having these filters to work together as a group

                      one should always check NULL values on each of them.

                      One may even Alias NULLs as something informative :-)


                      Another approach (complementary to the first one)

                      is making field names / values concatenated into a new field

                      and use it as a single all-inclusive filter instead of original four.


                      I've approached both ways in the attached

                      (using Superstore Region / State fields).

                      Hope it could help understanding.