本文介绍了在切换快速过滤器时,Tableau工具提示不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

链接到),它显示正确的等级,即<$ c $
$ b $> ://i.stack.imgur.com/FeuU2.pngrel =nofollow noreferrer>



但是只要选择任何 A





Tot_Avg计算方式如下:

$ $ p $ {EXCLUDE Avg_Rating像这样:

  AVG([评分])

以下是接收A的条件:

  IF [Avg_Rating]> ATTR([Tot_Avg]) - (.10 * ATTR([Tot_Avg]))
那么A

如何排除故障?

我觉得你的困惑是在 EXCLUDE 正在做。它不会忽略过滤器。只是在汇总 AVG([Rating])时,不要按位置进行分组。当您过滤除一个位置以外的所有位置时,AVG([评级]) {EXCLUDE [位置(Loc)]:AVG([评级]) } 变成等价的,因为无论是哪种计算方式,你都是对你的过滤分区中的所有点求平均值。

因此,如果只有一个位置,接收一个A将永远是真的。 (检查数学运算: X> X - .1X X> .9X



这里有一个不同的方式来获得你的东西。做一个计算的字段(我将称之为位置过滤器):

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

然后清理您的位置过滤器,并将其替换为该字段。我们在这里做了一些鬼鬼祟祟的事情 - 我们正在制作和以前一样的过滤器,但是我们把它伪装成一个表格计算(通过使用 LOOKUP() )。 Tableau在创建过滤分区之前不会执行表计算,所以我们已经欺骗了它,让我们在使用每个位置的同时仍然只是检查一个。


Link to workbook on public tableau

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

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

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

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?

解决方案

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 - .1XX > .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.

这篇关于在切换快速过滤器时,Tableau工具提示不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 00:03