Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tableau Hierarchy Filter for Scatterplot

Tags:

tableau-api

I am very new to Tableau, and I am trying to create a Scatterplot which can be viewed at different levels within the Hierarchy on the same Dashboard. For example, suppose I have employee counts, company counts and population density and I have this information by city, and these cities are in certain states.

I would like to be able to view the ratio # Employees/# Companies along the x-axis, population density along the y-axis, and I would like the ability to have each city shown as a separate bubble, and be able to, say, filter on Maryland, and show only the cities within for Maryland. This is all very straightforward using two quickfilters.

I'd also like to be able to somehow allow the user to specify that they want to see the bubbles at the State level, and once they select that option, it no longer shows the bubbles by city, it has aggregated those bubbles and is showing them by State. How do I do this?

Thanks!

like image 323
PJA Avatar asked May 23 '26 14:05

PJA


1 Answers

Well, that is very easy to do when you are editing the view (just drag the field to detail and use the collapse option), but not so easy to provide this option to users.

I can think of a little hack. Create a parameter named [Level]. Make it a list of values, like 'City' and 'State'.

Now create a calculated field [Level of detail]:

CASE [Level]
WHEN 'City' THEN [City]
WHEN 'State' THEN [State]
END

I'm assuming your city and state fields are named [City] and [State].

Now drag this [Level of detail] field to details, and let the user choose the parameter. When he chooses 'State', it should aggregate on State level. Same for City.

like image 161
Inox Avatar answered May 26 '26 21:05

Inox