Tableau tooltip incorrect when toggling through quick filter

+1 vote

I have created a calculated value to determine grade for business, and this is colormap (in tab Grade per Location)

enter image description here

And when I hover over datapoints on map (tab Map), it displays correct Grade, i.e. D for Shish Boom Bah Car Wash

enter image description here

But as soon as I select any location from a drop-down, all grades are A

enter image description here

Tot_Avg is calculated like this:

{ EXCLUDE [Location (Loc)] : AVG([Rating]) }

Avg_Rating like this:

AVG([Rating])

And here are the conditions for receiving an A:

IF [Avg_Rating]  > ATTR([Tot_Avg]) - (.10 * ATTR([Tot_Avg]))
THEN "A"

How to troubleshoot?

Jul 21, 2018 in Tableau by Atul
• 5,550 points
547 views

1 answer to this question.

0 votes

I think your confusion is in what that EXCLUDE is doing. It is NOT ignoring filters. It's just saying not to group by Location when aggregating AVG([Rating]). When you filter out all but one location, AVG([Rating]) and { EXCLUDE [Location (Loc)] : AVG([Rating]) } become equivalent, because with either calculation, you're averaging for all points in your filtered partition.

As a result, your condition for receiving an A will always be true if there's only one location. (Check the math: X > X - .1X → X > .9X)

Here's a different way to get what you're after. Make a calculated field (I'll call it Location Filter):

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

Then trash your Location filter and replace it with that field. We're doing something sneaky here - we're making the exact same filter as we had before, but we're disguising it as a table calculation (by using LOOKUP()). Tableau doesn't execute table calculations until after it's created the filtered partition, so we've tricked it into letting us use every location while still just examining one.

answered Jul 21, 2018 by Atul
• 10,230 points

Related Questions In Tableau

0 votes
1 answer

Getting incorrect tooltip while toggling through quick filter

I think what you want to ask ...READ MORE

answered Jun 27, 2018 in Tableau by Atul
• 5,550 points
187 views
0 votes
1 answer

How to hide measures on a Tableau filter?

Number of Records is just a predefined ...READ MORE

answered Jul 11, 2018 in Tableau by Atul
• 5,550 points
1,231 views
+1 vote
1 answer

How can I filter data on different sheets based on clicks on Tableau

Filter actions are an essential and fundamental ...READ MORE

answered Jul 20, 2018 in Tableau by Atul
• 5,550 points
5,819 views
+1 vote
1 answer

Tableau - Filter/Parameter For Different Date Ranges

Based on your comment and updated question, ...READ MORE

answered Jul 20, 2018 in Tableau by Atul
• 5,550 points
398 views
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,230 points
650 views
0 votes
1 answer

How to calculate profit when cost and revenue are in same column?

You can create the following calculated fields: Profit: SUM(IIF([account_category] ...READ MORE

answered Apr 10, 2018 in Tableau by Atul
• 5,550 points
370 views
0 votes
1 answer

Creating a calculated field with LOD expression

Go ahead and try the following three ...READ MORE

answered Apr 20, 2018 in Tableau by Atul
• 5,550 points
472 views
0 votes
2 answers

Calculation issue: Distinct sum in Tableau

I feel the easiest way is to ...READ MORE

answered Aug 26, 2020 in Tableau by Dhiraj Kumar Sahu
6,756 views
0 votes
1 answer

How to add filter to show latest two dates in tableau?

Steps for filtering based on the most ...READ MORE

answered Jun 21, 2018 in Tableau by Atul
• 10,230 points
328 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,230 points
7,435 views