Reputation: 305
I have a group of users who each have a variable that assigns them to a group. I can't share the data, but hopefully this example data will prove to be sufficient.
+-----+-----------+--------------+
| ID | Age Group | Location |
+-----+-----------+--------------+
| 1 | 18-34 | East Spain |
| 2 | 35-44 | North China |
| 3 | 35-44 | East China |
| 4 | 65+ | East Congo |
| 5 | 45-54 | North Japan |
| 6 | 0-17 | North Spain |
| 7 | 65+ | North Congo |
| 8 | 45-54 | East Japan |
| 9 | 0-17 | North Spain |
| 10 | 18-34 | East China |
| 11 | 18-34 | North China |
+-----+-----------+--------------+
My end goal is to create a sheet/dashboard, with a pie chart for age grouping. I want to filter this pie chart based on the Area, however, I want there to be two selections, one for Area (East/North), and one for Country (Spain/China/Congo/Japan). The filters will both be "Single Value Lists", so only one Area and one Country will be able to be selected at a time, but together they will combine to filter the patients. For example, if 'East' was chosen for the Area selection, and 'China' for the Country selection, the pie chart would only show for patients 3 and 10.
This helps reduce the number of selections that a user will have from 8, to 6. I know this isn't much of a difference, but in the actual data there are a lot more permutations and so the reduction would really help when de-cluttering the sheet/dashboard.
I've created the parameters for both Area and Country, but I don't know how to combine the two parameters to effect the patients that are selected.
Let me know if I can clarify anything. If parameters aren't the way to do this, I am also open to other suggestions!
Thanks so much!
Upvotes: 1
Views: 845
Reputation: 21
Why not split the location into two columns, then create filters for each column? Then you have exactly the functionality that you want just using filters without params and calculations
You could then drag Country onto Area in the data pane to tell Tableau there is a hierarchical relationship between the fields, and set the filter for Country to show "only relevant values", and the filter for Area to show "all values in the database" -- via the little black caret menu at the top right of the filter control.
Then the filter control for Country would only display values for the selected Area.
The other advantage this has is that you wouldn't need to maintain a separate list of parameter values. The set of values would be discovered automatically from your data. If areas or countries appear, get renamed or removed from your database, then you'll see that automatically in the filter choices. With parameters, if Korea unifies or the US splits into red USA and blue USA, you'll see that automatically and not risk preventing access to new data simply because your list of parameter values is out of date.
Upvotes: 2
Reputation: 7451
Create a calculated field that concatenates the values from your parameters and tests it against your location
field. Then put that calculated field in your filters card and set it to True
.
Calculated field should look like this:
([Area] + ' ' + [Country]) = [Location]
Upvotes: 1