The following example demonstrates functions that can be used to compare two sets of strings. These functions include the following:
STRINGGREATERTHAN- Evaluates to
trueif the first string is greater than the second string. See STRINGGREATERTHAN Function.
STRINGGREATERTHANEQUAL- Evaluates to
trueif the first string is greater than or equal to the second string. See STRINGGREATERTHANEQUAL Function.
STRINGLESSTHAN- Evaluates to
trueif the first string is less than the second string. See STRINGLESSTHAN Function.
STRINGLESSTHANEQUAL- Evaluates to
trueif the first string is less than or equal to the second string. See STRINGLESSTHANEQUAL Function.
The following table contains some example strings to be compared.
Note that in row #6,
stringB begins with a space character.
For each set of strings, the following functions are applied to generate a new column containing the results of the comparison.
derive value: STRINGGREATERTHAN(stringA,stringB) as: 'greaterThan'
derive value: STRINGGREATERTHANEQUAL(stringA,stringB) as: 'greaterThanEqual'
derive value: STRINGLESSTHAN(stringA,stringB) as: 'lessThan'
derive value: STRINGLESSTHANEQUAL(stringA,stringB) as: 'lessThanEqual'
In the following table, the
Notes column has been added manually.
|Evaluation differences between |
|Comparisons are case-sensitive. Uppercase letters are greater than lowercase letters.|
|Letters later in the alphabet (b) are greater than earlier letters (a).|
|Letters (a) are greater than digits (1).|
|Letters (a) are greater than non-alphanumerics (;).|
Digits (1) are greater than non-alphanumerics (;). Therefore, the following characters are listed in order of evaluation:
|Letters (and any non-breaking character) are greater than space values.|
|The second string is greater, since it contains one additional string at the end.|
|The second string is greater, since its first letter is greater than the first letter of the first string.|