简体   繁体   English

仅当字段在Tableau中具有一个条目时才计数

[英]count only if field has one entry in Tableau

I am using tableau and am stuck in making the field of the following code unique. 我正在使用tableau,并被困在使以下代码的字段唯一。

"COUNTD(
IF NOT(ISNULL([firstBillingDate]))
THEN [msisdn]
ELSE NULL
END
)"

Basically its counting unique msisdn 's for all the columns which have firstbillingDate present (NOT NULL). 基本上,它对存在firstbillingDate(NOT NULL)的所有列的唯一msisdn计数。

The problem is that one msisdn has more than one firstBillingDate . 问题是一个msisdn具有多个firstBillingDate I want to count unique msidns which has only ONE firstbillingdate 我想算一记唯一msidns firstbillingdate

Instead of using [firstBillingDate] in that calculation, create an LOD calc to only retrieve one date per msisdns. 不用在该计算中使用[firstBillingDate],而是创建LOD calc,以便仅每个msisdns检索一个日期。

{fixed [msisdns] : min([firstBillingDate]}

You can use max or min . 您可以使用maxmin I assumed you'd want min to return the earlier date for any multiple dates per msisdns. 我假设您希望min返回每个msisdns的任何多个日期的较早日期。 Now use this in your original calc. 现在,在您的原始计算中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM