Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc

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 s
snippetBasic

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 s
snippetSyntax

D code

derive type:single value:IFMISSING(column_string, computed_value)

ArgumentRequired?Data TypeDescription
source_valueYstringName of column, string literal or function to be tested
output_valueystringString literal value to write

D s lang notes

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.

D s
snippetusage

Required?Data TypeExample Value
YesString literal, column reference, or functionmyColumn

output_value

The output value to write if the tested value returns a null or missing value.

D s
snippetusage

Required?Data TypeExample Value
YesString or numeric literal'Missing input'

D s
snippetExamples

Example - IF* functions for data type validation

Include Page
EXAMPLE - IF Data Type Validation Functions
EXAMPLE - IF Data Type Validation Functions

D s also
labeltype