Tests whether a set of values is valid for a specified data type and is not a null value. |
true
or false
. You can use the ISVALID
function keywords interchangeably.
ISMISMATCHED
function, which tests for mismatches against a specified data type. However, the ISMISMATCHED
function also matches against missing values, while the ISVALID
function does not. See ISMISMATCHED Function.Column reference example:
(isvalid(Qty, 'Integer') && (Qty > 0)) |
Output: Returns true
when the value in the Qty
column contains a valid Integer and the value is greater than zero.
Column reference example for Datetime:
The Datetime data type requires a special formatting string as part of the evaluation of validity:
(isvalid(myDates, ['Datetime', 'yy-mm-dd hh:mm:ss','yyyy*mm*dd*HH:MM:SSX'])) |
Output: Returns true
when the value in the myDates
column conforms to either of the following date format strings:
yy-mm-dd hh:mm:ss yyyy*mm*dd*HH:MM:SSX |
For more information on these and other date format strings:
Numeric literal example:
isvalid('ZZ', 'State') |
Output: Returns false
, since the value ZZ
is not a valid U.S. State code.
isvalid(column_string,datatype_literal) |
Argument | Required? | Data Type | Description |
---|---|---|---|
column_string | Y | string | Name of column or string literal to be applied to the function |
datatype_literal | Y | string | String literal that identifies the data type against which to validate the source values |
Name of the column or string literal to be evaluated for validity.
'Hello, World'
).
Required? | Data Type | Example Value |
---|---|---|
Yes | String literal or column reference | myColumn |
Literal value for data type to which to match the source column or string. For more information, see Valid Data Type Strings.
Required? | Data Type | Example Value |
---|---|---|
Yes | String literal | 'Integer' |
Valid data type strings: