[英]Tableau check for multiple IDs across 2 groups
I want to create a set in tableau, which will show either one of these two values: Y or N 我想在tableau中创建一个集合,它将显示以下两个值中的一个:Y或N.
2 already existing columns are here important, "VAT-ID" and "CUSTOMER-ID". 2现有的列在这里很重要,“VAT-ID”和“CUSTOMER-ID”。 the new column should check if a customer-ID has multiple VAT-IDs. 新列应检查客户ID是否包含多个VAT-ID。 If yes, the value "Y" should be displayed, else "N". 如果是,则应显示值“Y”,否则显示“N”。 The table looks like: 该表看起来像:
customer-id VAT-id in-both 123456 EE999999999 Y 654321 AA999999999 N 666666 GG999999999 N 123456 KK999999999 Y 654321 AA999999999 N
any Help would be appreciated, I have tried IF [CustomerID] = 1 AND Count([VAT-ID]) > 1 THEN 'Y' ELSE 'N' END
which didn't work. 任何帮助将不胜感激,我已经尝试过IF [CustomerID] = 1 AND Count([VAT-ID]) > 1 THEN 'Y' ELSE 'N' END
无法正常工作。
You are close. 你很亲密 For this you need an LOD (Level of Detail) expression. 为此,您需要一个LOD(细节级别)表达式。 LOD expressions allow you to do calculations at a different granularity then the view is rendered. LOD表达式允许您以不同的粒度进行计算,然后呈现视图。
You can use: 您可以使用:
if
{fixed [Customer-Id]: countd([VAT-id]) } > 1
then 'Y'
else 'N'
end
The LOD is the {fixed...}
. LOD是{fixed...}
。 The way you read this is you want to count the distinct number of VAT-id per each Customer-id. 您阅读本文的方式是,您希望计算每个Customer-id的VAT-id的不同数量。 (eg 123456 will return 2; all others will return 1). (例如123456将返回2;所有其他人将返回1)。 Then you just wrap that in an If statement. 然后你只需将它包装在If语句中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.