See the attached. What was happening was that when the state gets clicked on, the Action Filter is sending Null for a City value to the City Index worksheet. I added a calculated field that returns Null for the ALL city, then adjusted the Filter Action fields so it uses that field in the City Index target worksheet instead of the City field.
I'm not sure what you mean by, "Normally, you would do this through aggregations, but in this case, the index for all the cities of a State cannot be calculated through aggregations." There are relatively few cases of aggregation that cannot be computed within Tableau (often using table calculations to get aggregations of aggregations), can you describe more of the issue that you ran into?
Thank you for your help Jonathan. Could you please publish it on Tableau Public? For some reason I can only open the previous version.
The thing is that I only have the index for each city and for the whole state, not the information from which those indexes were calculated, and to calculate the index for the state as a whole I cannot simply sum or average (or other type of aggregation) all the city indexes. I would need to have the raw data.
1 of 1 people found this helpful
Thanks for the explanation, that makes sense. Here's the Tableau Public link: http://public.tableausoftware.com/views/MapFilterActionwithExistingAgg/Dashboard?:embed=y&:display_count=no
Your solution totally worked out for my dashboard Jonathan!
Thanks a lot!
Sorry to bother you again Jonathan Drummey , but on this same example, I have added a "State" filter. When I select a new State on this filter, the line chart still shows the last selected city. I want it to show the "ALL" value when the user selects a State. I have been playing with the logic of the dashboard but I can't get to pull it off.
Any help is apprecciated.
What's happening is that the Filter Action and State filters are crossing each other up:
- Let's say that Ithaca, NY has been selected, so that's the value for the Filter Action.
- Then when the user chooses Connecticut from the Quick Filter, that's the value for the Quick Filter.
- The City Index field is then trying to get Ithaca, NY AND Connecticut and of course there's no state that is both NY and CT.
There's no way I know of for a Filter Action to change what is *currently* selected in a Quick Filter, or vice versa (though once we choose one then that can change what options are available for the other). The same goes for parameters, which can sometimes be used in these situations. I'm not sure of what your goal is for the interactions in this case, and that makes it harder for me to come up with any ideas. One thought I have is to get rid of the Quick Filter, show all the states at once and use Highlight Actions, so all states/cities would be shown at once and the user could click on a specific state to see results for that state, or click on a city to see results for that city. That would certainly require some explanatory text, though. I'm sorry I can't come up with more options.
Thanks for the response Jonathan. I finally opted to show all states at once, and let the user zoom in using the map controls. The purpose of the filter was to let the user zoom in at the desired State and to filter out all cities that weren't of that state.