4 Replies Latest reply on Sep 19, 2018 1:39 PM by lynn.davey

    Trouble using sets to filter visualization options

    lynn.davey

      Hi there. I have created two sets that I would like to use as filters for users to sort the data. The problem is that there is overlap in members of the sets, and I don't know how to handle that.

      These are survey data on Adverse Childhood Experiences (ACEs). Survey respondents indicated whether they had 0, 1, 2, 3, or 4 ACEs.

      I would like users to be able to see, e.g., the individual ACE scores by Education level, as in attached workbook.

      But I would also like them to compare just two groups: those with 0 ACEs, to those with 1 or more.  And I have the data in that way.

      I created two sets, and then a calculated field that I called "Sorting" that I used as a filter.

       

      Two questions -

      1. Using sets isn't doing it, because of course 0 ACEs are in both sets. How do I deal with this? I'm not familiar with parameters etc so would love some instruction

      2. How do I get rid of the else "" showing up as a blank box in the resulting filter?

       

      Thanks in advance for help!

        • 1. Re: Trouble using sets to filter visualization options
          Michael Hesser

          Hi Lynn;

          Rather than going the SETS route, you may want to try GROUPS. A simple calculation can control if your columns are displayed in groups or individual ACE scores.

           

          You data, however, perplexed me. Are you able to reformat it so you have only integers?

          • 2. Re: Trouble using sets to filter visualization options
            lynn.davey

            I don't want to group them, actually. In the Workbook I attached, if you look at the filter options, it's pretty much how I want people to be able to interact with it.  They can select the "ACEs Grouped" option to compare those with 0 ACEs to those with 1 or more.  Or they can select the "Individual ACE Score" option, to compare the educational achievement of people with each ACE score (0,1,2,3 or 4).

            The problem is the "0 ACEs" option isn't showing up in that latter filter.

            I assume it's because in creating a set, it can't be in two sets at the same time.

            That's what I want to figure out how to correct.

            • 3. Re: Trouble using sets to filter visualization options
              Michael Hesser

              Hi Lynn;

              Is there a reason you prefer not to group them?

              I was able to get this functioning (at least it looks like it) in 4-5 steps, but one of those is creating a GROUP.

               

              I was able to get this to work without a group, too:

              • Start by making a [Selector] parameter (0=Group, 1=Individual)
              • Use your existing sets
              • Create a calc:

               

              Select

              STR(if [Selector]="0" then [ACEs Grouped]

              else [Individual ACE scores]

              END)

               

              • I changed this calc from T/F into a string before dropping it on Filters and choosing only T values

               

              I'm uncertain if the internal calculations are accurate,m because without grouping, your sets aren't aggregating.

               

              Hope this is food for thought. --Michael

              • 4. Re: Trouble using sets to filter visualization options
                lynn.davey

                I might have confused you, and am sorry! I already have the data grouped as "1 or more" in the original data base. So I'm not having to manipulate the data in Tableau to get there. That is something I should have been more clear about!!

                Thank you so much for your attention to this.

                I just figured it out thanks to your help. Parameter + Calculated field was the answer.

                Much appreciated!