Rhonda
Rhonda

Reputation: 1721

Tableau calculated-field filter on pie-chart doesn't work

Based on previous question, I had to create calculated value for Location, and use that as quick filter, i.e.

Location Filter:

LOOKUP(ATTR([Location (Loc)]),0)

Workbook is on Public Tableau

For hovering over points in a map, the calculated field works, but when I create pie chart, it doesn't work.

For instance, if I select All, this is the result

enter image description here

And if I select a business from Location Filter, this is what I get

enter image description here

How to troubleshoot?

Additional Info

However, if I use regular Location filter, then it works, i.e

enter image description here

Upvotes: 0

Views: 877

Answers (1)

Andrew LaPrise
Andrew LaPrise

Reputation: 3413

There are two separate issues to address here:


LOOKUP(ATTR([Location (Loc)]),0) is a sneaky way of filtering the data in the view while still maintaining all of the locations in the partition (by disguising the field as a table calculation, the filtered partition is created before this table calculation is ever executed). Because you've used it here, you still have every location in the partition, even when you filter them out with the quick filter. Because they're still in the partition, when you calculate the percent of total, those other locations will be included in that total, even if they're not displayed in the view.

I don't see a reason for you to keep all of the locations in your partition in this case, so I'd just replace that filter with [Location].


It looks like you've dragged [Location] into your mark as a dimension. As a result, it's broken up the pie slices into smaller chunks, one per location. If you add a dimension to your data, then Tableau will have to group by that dimension when calculating the aggregations.

If you want the Location to appear in the tooltip of your pie chart, you'll have to either add it as an attribute (in which case you'll have to deal with the "*" when you have more than one location in the partition), or you'll just have to deal with the slices being broken up further.

Upvotes: 1

Related Questions