Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Applies to:  
Status
colourGreen
titleCelonis 4.0
 
Status
colourGreen
titleCelonis 4.2
 
Status
colourGreen
titleCelonis 4.3
 
Status
colourGreen
titleCelonis 4.4
 


Description

The ISNULL function returns an INT which indicates whether the input value is NULL. If the input value is NULL, 1 is returned, and 0 otherwise.

ISNULL can be applied to any data type.

Typically, ISNULL is used inside a condition, for example in a CASE WHEN or FILTER statement. In order to map NULL values to a different value, COALESCE or REMAP_VALUES can also be used instead of a CASE WHEN combined with ISNULL.

Syntax


Code Block
languagetext
themeDJango
ISNULL ( table.column ) 


Examples


Return the result of the ISNULL operator for a STRING column and use it inside a CASE WHEN condition:


Panel
titleQuery
Column1


Code Block
languagetext
themeDJango
ISNULL ( "Table1"."Country" )


Column2


Code Block
languagetext
themeDJango
CASE WHEN ( ISNULL ( "Table1"."Country" ) = 1 ) THEN '-' ELSE "Table1"."Country" END




Panel
titleInput
Table1


Country : STRING
'US'
'DE'
null
'IT'
'DE'
null
'FR'




Panel
titleOutput
Result


Column1 : INTColumn2 : STRING
0
'US'
0
'DE'
1
'-'
0
'IT'
0
'DE'
1
'-'
0
'FR'






Return the result of the ISNULL operator for a INT column and use it inside a CASE WHEN condition:


Panel
titleQuery
Column1


Code Block
languagetext
themeDJango
ISNULL ( "Table1"."IntColumn" )


Column2


Code Block
languagetext
themeDJango
CASE WHEN ( ISNULL ( "Table1"."IntColumn" ) = 1 ) THEN 0 ELSE "Table1"."IntColumn" END




Panel
titleInput
Table1


IntColumn : INT
1
0
10
13
null
null
-5




Panel
titleOutput
Result


Column1 : INTColumn2 : INT
0
1
0
0
0
10
0
13
1
0
1
0
0
-5






See also: