Excerpt |
---|
Tests whether a set of values is not valid for a specified data type. |
- For a tested value, this function returns
true
or false
. - Inputs can be literal values or column references.
You can define a conditional test in a single step for valid values. See IFMISMATCHED Function.
Info |
---|
NOTE: This function is similar to the ISVALID function, which tests for validity against a specified data type. However, unlike the ISVALID function, the ISMISMATCHED function also matches against missing values. See VALID Function. |
Column reference example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | delete row:(ismismatched(Qty, 'Integer') || (Qty < 0)) |
---|
|
ismismatched(Qty, 'Integer') || (Qty < 0) |
Output: Returns true
when the value in the Qty
column does not contain a valid Integer and the value is less than zero.
Numeric literal example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: ismismatched('ZZ', 'State') |
---|
|
ismismatched('ZZ', 'State') |
Output: Returns true
, since the value ZZ
is not a valid U.S. State code.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:ismismatched(column_string,datatype_literal) |
---|
|
ismismatched(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 |
column_string
Name of the column or string literal to be evaluated for mismatches against the specified type.
- Missing literals or column values generate missing string results.
- Constants must be quoted (
'Hello, World'
).
- Multiple columns and wildcards are not supported.
Required? | Data Type | Example Value |
---|
Yes | String literal or column reference | myColumn |
datatype_literal
Literal value for data type to which to validate the source column or string.
- Column references are not supported.
Required? | Data Type | Example Value |
---|
Yes | String literal | 'Integer' |
Valid data type strings:
Include Page |
---|
| Valid Data Type Strings |
---|
| Valid Data Type Strings |
---|
|
Example - Type check functions
Include Page |
---|
| EXAMPLE - Type Functions |
---|
| EXAMPLE - Type Functions |
---|
|