Excerpt |
---|
The IFMISSING function writes out a specified value if the source value is a null or missing value. Otherwise, it writes the source value. Input can be a literal, a column reference, or a function. |
- The
ISMISSING
function simply tests if a value is missing. See ISMISSING Function. - Missing values are different from null values. To test for null values, see IFNULL Function.
Tip |
---|
Tip: Since this function captures both missing and null values, you may first wish to address the rows with null values using the IFNULL or ISNULL functions. Any remaining rows that are matched based on this function are exclusively missing values. |
D code |
---|
derive type:single value:IFMISSING(my_score,'0') as:'final_score' |
Output: Generates a new column called, final_score
, which contains the value 0
if the value in my_score
is a null or missing value.
D code |
---|
derive type:single value:IFMISSING(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 missing 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 or missing value.
Required? | Data Type | Example Value |
---|
Yes | String or numeric literal | 'Missing input' |
Example - IF* functions for data type validation
Include Page |
---|
| EXAMPLE - IF Data Type Validation Functions |
---|
| EXAMPLE - IF Data Type Validation Functions |
---|
|