The |
The VALID
function simply tests if a value is valid. See VALID Function.
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(myDate, ['Datetime','mm-dd-yy','mm*dd*yy'], 'true') |
Output: Returns the value true
, if the value in the myDate
column is a valid Datetime value in yy-mm-dd
or yy*mm*dd
format.
ifvalid(column_string, data_type_literal, computed_value) |
Argument | Required? | Data Type | Description |
---|---|---|---|
source_value | Y | string | Name of column, string literal or function to be tested |
datatype_literal | Y | string | String literal that identifies the data type against which to validate the source values |
output_value | y | string | String literal value to write |
Name of the column, string literal, or function to be tested for data type matches.
Required? | Data Type | Example Value |
---|---|---|
Yes | String literal, column reference, or function | myColumn |
Literal value for data type to which to validate the source column or string.
Required? | Data Type | Example Value |
---|---|---|
Yes | String literal | 'Integer' |
Valid data type strings:
The output value to write if the tested value is valid for the specified data type.
Required? | Data Type | Example Value |
---|---|---|
Yes | String or numeric literal | 'Data type mismatch' |