Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count the number of occurrences of Null in a column in tableau

Tags:

tableau-api

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.

like image 867
Dan Avatar asked Jun 07 '16 14:06

Dan


1 Answers

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.

like image 108
Nick Avatar answered Sep 30 '22 12:09

Nick