...
The VALID
function simply tests if a value is valid. See VALID Function.
d-codelang-syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: |
---|
| IFVALIDifvalid(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:
d-code-lang-syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | set col: validDate value: |
---|
| IFVALIDifvalid(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-code-lang-syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value: |
---|
| IFVALIDifvalid(column_string, data_type_literal, computed_value) |
|
ifvalid(column_string, data_type_literal, computed_value) |
...