5 Replies Latest reply on Mar 10, 2014 12:35 PM by Tracy Rodgers

    Set default filter value

    Anuj Bajaj

      Hi All,


      I have couple of questions. Please see the attached workbook.

      Dash 1 Sheet

      1. Default Filter Selection: I want to set 2013 check-box as default and don't want to allow the user to change it. Even after user selects "All" and then un-checks "All", the year 2013 check-box should remain checked/selected. Is that possible in tableau?

      Dash 2 Sheet

      1. Totals for stacked bar chart: When the user selects chrysler and GMC, the bar becomes a stacked bar chart and shows individual count for chrysler and GMC by region. Is there a way to show the totals for each region? for e.g. GMC - India count = 109

              Chrysler - India count = 11

      I'd like the chart to show the total for India as 120.

       

      Thanks and appreciate your help

        • 1. Re: Set default filter value
          Tracy Rodgers

          Hi Anuj,

           

          Create a string parameter that lists: All, 2013, 2014 and 2015.

           

          Then, create a calculated field similar to the following:

           

          if Year='2013' then '2013'

          elseif Year=[Parameters].[Year] then [Parameters].[Year]

          elseif [Parameters].[Year]='All' then [Year]

          end

           

          Remove the Year field from the filter shelf, and replace it with the above calculation. Then, check the Exclude box and null (this will only be available if All is not selected on the parameter--you may need to change the selection on the parameter). Then, click OK and right click on the parameter, selecting Show Parameter Control.

           

          For number 2, I'm not quite sure where the values above are being calculated from. Can you provide some more clarification?

           

           

          -Tracy

          • 2. Re: Set default filter value
            Matt Lutton

            You can duplicate your YEAR field, and on the copy exclude any other years, then set the original YEAR field to "only relevant values" so only 2013 is selectable.

             

            However, some Companies, like GMC and Chrysler mentioned in your question, do not have data in 2013, so excluding the other years may not make sense for this data set.

            • 3. Re: Set default filter value
              Tracy Rodgers

              Hi Matthew,

               

              Using the duplicate option, more than one year won't be able to be selected. My understanding was that the user should be able to select other years in addition to 2013 and that 2013 would always be selected.

               

              -Tracy

              • 4. Re: Set default filter value
                Matt Lutton

                I read the requirement as only allowing 2013 to be selected; but you're probably right, based on the fact that filtering the other years will make some filter selections invalid. Cheers

                • 5. Re: Set default filter value
                  Tracy Rodgers

                  Well, either way, hopefully, his question will be answered!