Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

...

D s
snippetBasic

Basic data type:

IFMISMATCHED
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
ifmismatched(my_ssn,'SSN', 'XXX-XX-XXXX') as:'final_SSN'

...

ifmismatched(my_ssn,'SSN', 'XXX-XX-XXXX')

Output: Returns the value XXX-XX-XXXX if the value in my_ssn does not match the SSN data type. 

Data type with formatting options:

For data types with formatting options, such as Datetime, you can specify the format using an array, as in the following:

IFMISMATCHED
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextset col: month_Date value:
ifmismatched(month_Date, ['Datetime','mm-dd-yy','mm*dd*yy'], null())

...

ifmismatched(month_Date, ['Datetime','mm-dd-yy','mm*dd*yy'], null())

Output: Returns null if values in month_Date are mismatched against Datetime values in the mm-dd-yy or mm*dd*yy formats.

D s
snippetSyntax

IFMISMATCHED
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
ifmismatched(column_string, data_type_literal, computed_value)

ifmismatched(column_string, data_type_literal, computed_value)


ArgumentRequired?Data TypeDescription
source_valueYstringName of column, string literal or function to be tested
datatype_literalYstringString literal or array that identifies the data type against which to validate the source values
output_valueystringString literal value to write

...