Today at the Data School we spent the day training on #WorkoutWednesday challenges to sharpen our Tableau skills. I worked on one crafted by Emma Whyte last year. I haven’t had the chance to work a lot with sets so I was quite happy to get more acquainted with them while discovering a really useful little technique I will share with you!
Set up a dynamic set
In a few clicks, you can create a set that dynamically updates based on a parameter. Here I created a set identifying the top N customers based on their average sales. By then dragging the set in the row shelf next to the customer names, I split them given them into in/out (if they are in the top N set or not).
Show or hide the out members
Now here comes a very neat little trick that I am sure I will get to use across my next projects/placements. While you are most probably interested in seeing the details of the members of your set, you might not want to have the details about the other ones. You can actually set up a parameter that hides or shows them.
Just create a [Show/Hide] string parameter with “Show” or “Hide” as values. Then you will need a nested if calculation that goes like this:
IF [Show/Hide] = ‘Hide’
IF [Top Customers by Sales]
THEN [Customer Name]
ELSE [Customer Name]
Drag your new field into the rows, next to the to your set and you’re done, changing your parameter will either expand or collapse the customers outside the set. Voilà!