1 Reply Latest reply on Dec 15, 2017 1:35 PM by Vinnie Ahuja

    Combine a group of values (from a dimension) and the values themselves into one filter

    Maarten Van den Broeck

      Hi,

       

      I want to create a filter where I have a group of values (from a dimension) and the values themselves. For example, say I have a dimension 'Country', and I want to be able to filter them based on each individual country, but also on groupings of countries. This should result in a dropdown filter box where you can select group A, group B, group C... but filter by a separate country as well.

        • 1. Re: Combine a group of values (from a dimension) and the values themselves into one filter
          Vinnie Ahuja

          You could try duplicating the country field and call it, say, "Country 2".  Then you could either use the grouping functionality in Tableau to construct the needed groups (group A, group B, etc.) in "Country 2" or create a calculated field (called, say, "Country Groups"):

           

          if [Country 2] = "USA" or [Country 2] = "Canada" or [Country 2]="Mexico" then "Group A"

          Elseif....

          Elseif...

          END

           

          You could then add Country AND Country 2 (group) or "Country Groups" (depending if you grouped or used a calculated field) to the filters shelf and use them both as needed.

           

          Depending on what you're specifically trying to do, you may want to set one of the filters to exclude and the other to include and/or add one of them to the context.

           

          All of this, of course, is really dependent on how many groups you're thinking of...it could get very tedious after a while.

           

          Hope that helps!


          Thanks

          Vinnie