As others have pointed out, you can use ISNULL() to test whether a field has a null value. Testing for the presence or absence of a value using ISNULL() is different than testing a value with equality
This is not exactly the case you asked about, but sometimes, you may have a default value for a field that you always want to use in cases when there is no value specified, in that case, the IFNULL() function is useful. It returns the value of its first argument if there is a non-null value, otherwise it returns the value of the second argument.
Let's say you have a field called Approver, and if no Approver is specified in the data, then the default value is "Fred". A reliable approach is to first:
- Rename the Approver field in Tableau to, say, Approver-Original
- Define a new Approver field as
ifnull(Approver-Original, "Fred")
- Hide the field Approver-Original
Then you can safely use Approver anywhere you wish knowing that it always has a value, and the information about applying defaults is in one place.
There is also a function called ZN() for numeric field that returns zero if the argument is null. Useful in those cases where zero is the correct default.
All this makes sense in cases, where it makes sense to have a default value to replace null.
There are other cases when you really want to leave a value null to represent the absence of data, say a field called Spouse that will be null for single people. Assigning a default spouse in that case would be wrong, and possibly not appreciated. ISNULL() is useful in that case.