问题描述
我对 Tableau 比较陌生,我想知道是否有一种方法可以计算列中的空值.我有一列名为字符串类型的电子邮件,想知道有多少人没有输入他们的电子邮件,即 Null.
我尝试创建一个计算字段计数(ISNULL([电子邮件]))
但这给了我总计数而不是空值计数.
谢谢.
你不能计算 NULL
,因为 COUNT
忽略了 NULL
s.>
你可以这样做:
SUM(IF ISNULL([Email]) THEN 1 ELSE 0 END)
根据您的附加评论,如果您想计算两个字段都为 NULL
的位置,则:
SUM(IF ISNULL([Email]) AND ISNULL([Phone]) THEN 1 ELSE 0 END)
您可以根据需要为任意数量的字段继续此操作.
I am relatively new to Tableau and I am wondering if there is a way to calculate null values in a column.I have a column called Email of type string and want to know how many people have not entered their email i.e. Null.
I tried to create a calculated field withcount(ISNULL([Email]))
But this gives me the total count and not the count of null.
Thanks.
You cannot count NULL
since COUNT
ignores NULL
s.
You can do this, though:
SUM(IF ISNULL([Email]) THEN 1 ELSE 0 END)
Per your additional comment, if you wanted to count where two fields are both NULL
then:
SUM(IF ISNULL([Email]) AND ISNULL([Phone]) THEN 1 ELSE 0 END)
You can continue this for any number of fields, as needed.
这篇关于计算tableau中一列中Null的出现次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!