Excerpt |
---|
The IFNULL function writes out a specified value if the source value is a null. Otherwise, it writes the source value. Input can be a literal, a column reference, or a function. |
- The
NULL
function generates null values. See NULL Function. - The
ISNULL
function simply tests if a value is null. See ISNULL Function. - Null values are different from missing values.
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:ifnull(my_score,'0') as:'final_score' |
---|
|
ifnull(my_score,'0') |
Output: Returns the value 0
if the value in my_score
is a null.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:ifnull(column_string, computed_value) |
---|
|
ifnull(column_string, computed_value) |
Argument | Required? | Data Type | Description |
---|
source_value | Y | string | Name of column, string literal or function to be tested |
output_value | y | string | String literal value to write |
source_value
Name of the column, string literal, or function to be tested for null values.
- Missing literals or column values generate missing string results.
- Multiple columns and wildcards are not supported.
Required? | Data Type | Example Value |
---|
Yes | String literal, column reference, or function | myColumn |
output_value
The output value to write if the tested value returns a null value.
Required? | Data Type | Example Value |
---|
Yes | String or numeric literal | 'Null input' |
Example - IF* functions for data type validation
Include Page |
---|
| EXAMPLE - IF Data Type Validation Functions |
---|
| EXAMPLE - IF Data Type Validation Functions |
---|
|