计算tableau中一列中Null的出现次数 [英] Count the number of occurrences of Null in a column in tableau

查看:89
本文介绍了计算tableau中一列中Null的出现次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Tableau 比较陌生,我想知道是否有一种方法可以计算列中的空值.我有一列名为字符串类型的电子邮件,想知道有多少人没有输入他们的电子邮件,即 Null.

我尝试创建一个计算字段计数(ISNULL([电子邮件]))

但这给了我总计数而不是空值计数.

谢谢.

解决方案

你不能计算 NULL,因为 COUNT 忽略了 NULLs.>

你可以这样做:

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 with count(ISNULL([Email]))

But this gives me the total count and not the count of null.

Thanks.

解决方案

You cannot count NULL since COUNT ignores NULLs.

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的出现次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆