Tableau Count distinct of count distinct

时间:2017-04-06 16:54:51

标签: tableau

I have below data

Name    Product
XYZ A
XYZ B
XYZ A
MAP Z
MAP Z

I want only those customers that have more than 2 distinct products. So in the above example, we get only XYZ, so the count is 1. Not sure how to do it. Thanks, Hema

1 个答案:

答案 0 :(得分:0)

如果您只想查看没有不同产品信息的客户,您可以将名称药片拖到行中,创建计算字段distinct_products

COUNTD([Product])

并将其拖动到过滤器。选择“至少”并输入“2”。

如果您仍希望查看产品信息,则可以使用Tableau中的Level of Detail expressions和过滤器解决此问题。

创建一个新的计算字段distinct_products,如下所示:

{exclude [Product]: COUNTD([Product])}

将其拖动到过滤器并选择属性。然后选择“至少”并输入“2”作为值。现在过滤器就位。你需要的是将'Name'药片拖到行上。 如果您希望将产品显示在一行中:将产品药片拖到“文本”。如果您希望产品以多行显示,请将其拖到行中。