How does Tableau recognize is not null in a calculated field?

  • Tableau FAQs
  • December 10, 2018
Get Started Transforming Your Data in Snowflake

In this post, we will use the Tableau ISNULL() command to do this.  It will return true if it’s null and false if not.

To recognize NULL, you must use the ISNULL function, but there are several ways to do this. The first way is to make a calculated field using the IF condition (as shown in the image below), then you can specify any value in the results of the condition. In a second method, you can use the ISNULL function, and the result will be in boolean format.

IF                                      

    ISNULL([TerritoryName])

    THEN 1

    ELSE 0

END

IF ISNULL([TerritoryName])  –  This is the beginning of a conditional expression in which we specify a condition in which we look for a NULL value in [Selected Field], and the result of this expression will be TRUE or FALSE.

THEN 1  – If the previous condition is TRUE, then the value 1 will be added to the new field

ELSE 0  – If the result of the condition is FALSE, and then the value 0 will be added to the new field.

END  –  This function is used to close a conditional expression.

Tableau ISNULL

ISNULL([TerritoryName]) – Returns TRUE if expression does not contain NULL

ISNULL([TerritoryName])


Up Next:

Read How do I create a formula for only the last month of data from max date in Tableau?