1 Reply Latest reply on Aug 29, 2012 10:57 AM by Andy Piper

    Limit the number of filters

    Jessica Gibas

      I have about 10 variables, both string and numerical, that I would like to offer the viewer as filters but I only want them to be able to select 3 at a time. The three filters they select can be all string, all numerical, or a mixture of both. My main objective is to get down to three active quick filters. I need the end result to be quick filters so that I can have the slider option for the continuous numerical variables.

       

      The first major problem I have run into is that in a CASE calculated field, the result types have to match. Meaning that if I set up a parameter listing all 10 variables the below calculated field is not allowed:

       

      CASE P1

      When “Region” then [Region]

      When “Age” then [Age]

      End

       

      I have tried to create 2 parameters (1 for the string variables, 1 for the numerical) for the choice of one filter. But I then can’t find a way to limit the viewer to select either a string or numerical filter. I tried adding in a choice called “No Choice” for the string parameter (String P) and then created a calc field = if [String P]="No Choice" then [Num P] else [String P] end. Which works in the fact that the String P calc field quick filter completely clears when “No Choice” is selected but then causes an error message when a value in Num P is selected.

       

      I have also tried using action filters on a dashboard since I have the option to make these quick filters global (meaning they could be on a different sheet and still filter my main graph). My thought was that I could have a list (almost like a table of contents) and clicking on a variable name would bring up that quick filter (I would have a sheet for each variable). The problem here is that a filter action will clear only the graph and leave the quick filters when you select “exclude all values” when the selection is cleared. This would allow someone to filter by as many variables as they want since all the quick filters still appear.

       

      I have my data in excel and it comes in from surveys so it looks similar to http://www.datarevelations.com/using-tableau-to-visualize-survey-data-part-1.html after reshaping.

       

      I'm attaching a bare bones screen shot of what I would like to acheive.

       

      Any help is greatly appreciated!!

        • 1. Re: Limit the number of filters
          Andy Piper

          Jessica,

           

          It's been a while since you posted, but I just ran across this looking for an answer to a question I had.

           

          However, I think what your asking about can be done. I create dynamic tables using parameters in which the user chooses the fields to display on the rows and columns; often a date or numeric field needs to be incorporated along with the list of dimensions.You may be able to bring all 10 variables together by using an STR() statement surrounding your date and numerical fields within your case/when statement.

           

          For example:

          CASE P1

          When “Region” then [Region]

          When “Age” then [Age]

          When "Num P" then STR([Num P])

          End

           

          If this doesn't work or you, would you be able to post a packaged workbook so I have a better understanding of how your fields and parameters are set up?

           

          Andy