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

...

The VALID function simply tests if a value is valid. See VALID Function.

D s
snippetBasic

IFVALID
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
ifvalid(myZip,'ZipCode', 'ok') as:'myZipCheck'

ifvalid(myZip,'ZipCode', 'ok')

Output:

...

 Returns the value ok if the value in myZip matches the ZipCode 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:

IFVALID
d-code-lang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextset col: validDate value:
ifvalid(myDate, ['Datetime','mm-dd-yy','mm*dd*yy'], 'true')

ifvalid(myDate, ['Datetime','mm-dd-yy','mm*dd*yy'], 'true')

Output: Sets the values in the validDate column to Returns the value true, if the corresponding value in the myDate column is a valid Datetime value in yy-mm-dd or yy*mm*dd format.

D s
snippetSyntax

IFVALID
d-code-lang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
ifvalid(column_string, data_type_literal, computed_value)

ifvalid(column_string, data_type_literal, computed_value)

...