Professional Documents
Culture Documents
CONDITIONAL
A conditional function performs an action or calculation based on a test of data using an
IF statement. Use a conditional function to provide a TRUE or FALSE result to highlight
or filter out data based on specific criteria. Conditional functions can be used with any
data type.
Consider each conditional function before writing your test. Some conditional functions
are better suited to specific use cases.
Example
Class Result
1 Gold
2 Other
1 Gold
3 Other
Example
IF [Class]==1 THEN "Gold" ELSEIF [Class]==2 THEN "Silver" ELSE "Other"
ENDIF
Class Result
1 Gold
2 Silver
1 Gold
3 Other
Example
Example
Result Class
5 Aluminum
2 Silver
Result Class
1 Gold
3 Bronze
4 Tin
2 Silver
1 Gold
Null Other
OPERATORS
//Comment: Single Line Comment: Allows you to add comments to an expression editor
without interfering with the expression.
Addition +: Addition
Boolean AND &&: Boolean AND: Used to combine two Boolean values. The result is
also a Boolean value. The result is true if both of the combined values are true, and the
result is false if either of the combined values is false.
Boolean AND - Keyword: Boolean AND: Used to combine two Boolean values. The
result is also a Boolean value. The result is true if both of the combined values are true,
and the result is false if either of the combined values is false.
Boolean NOT !: Boolean NOT: Accepts one input. If that input is TRUE, it returns
FALSE. If that input is FALSE, it returns TRUE.
Boolean NOT - Keyword: Boolean NOT: Accepts one input. If that input is TRUE, it
returns FALSE. If that input is FALSE, it returns TRUE.
Boolean OR - Keyword: Boolean OR: If either (or both) of the two values it checks are
TRUE, then it returns TRUE.
Boolean OR ||: Boolean OR: If either (or both) of the two values it checks are TRUE,
then it returns TRUE.
Division /: Division
Equal To =: Equal To
Multiplication *: Multiplication
Subtraction -: Subtraction
value IN (...) - Keyword: Test Value in List: Determines if a given value matches
any value in a subquery or a list.
The CONTAINS function is case insensitive while the FINDSTRING function is case
sensitive.
Example
CountWords(String): Returns the count of words in the specified String. Words are
defined by characters separated by a space.
Example
This function is useful for matching only. It is not considered a normalized string.
Example
Example
The EndsWith function is case insensitive while the FindString function is case
sensitive.
Returns the 0 based index of the first occurrence of Target in String. Returns -1 if no
occurrence.
Example
FindString([Name], "John") returns 0 when the string contains John and returns -1
when the string does not.
GetWord(String, n): Returns the Nth (0-based) word in the String. Words are defined
as a collection of characters separated by a space. 0-based index, means the first word
is at the 0 position.
Example
Left(x, len): Returns the first [len] characters of the string (x). If len is less than 0 or
greater than the length of x, x remains unchanged.
Example
Example
Example
LowerCase("M1P 1G6") returns "m1p 1g6"
MD5_ASCII(String): Calculates the MD5 hash of the string. The string is expected to
be only ASCII characters. Unicode® characters are turned into ? before calculating the
MD5 hash.
PadLeft (str, len, char): Pads the string to the left with the specified character to
the specified length. If the padding “char” is more than one character long, only the first
character will be used.
Example
PadRight (str, len, char): Pads the string to the right with the specified character
to the specified length. If the padding “char” is more than one character long, only the
first character will be used.
Example
The icase is an optional parameter. When specified, the case must match. By default
icase=1 meaning ignore case. If set to 0, the case must match.
Consult the Boost Regex Perl Regular Expression Syntax page to make the building of
the expression easier.
Tells if the string matches the pattern from the first character to the end. To look for
something that does not necessarily start at the beginning of the string, start the pattern
with '.*'. To look for something that does not necessarily go all the way to the end of the
string, end the pattern with '.*'.
Consult the Boost Regex Perl Regular Expression Syntax page for more information on
how to properly construct a regular expression.
icase is an optional parameter. When specified, the case must match. By default
icase=1 meaning ignore case. If set to 0, the case must match.
Example
Consult the Boost Regex Perl Regular Expression Syntax page to make the building of
the expression easier. The replace parameter can be either a specified value as shown
below, or a marked group, such as "$1"
icase is an optional parameter. When specified, the case must match. By default
icase=1 meaning ignore case. If set to 0, the case must match.
Example
Replace(Str, Target, Replacement): Returns the string (Str) after replacing each
occurrence of the String (Target) with the String (Replacement).
Example
ReplaceChar(x, y, z): Returns the string (x) after replacing each occurrence of the
character (y) with the character(z). If the replacement character (z) is a string with more
than one character, only the first one is used. If (z) is empty, each character (x) that
matches any character in (y) is simply removed.
Example
Example
Example
Right(String, len): Returns the last (len) characters of the string. If len is less than
0 or greater than the length of String, the string remains unchanged.
Example
The StartsWith function is case insensitive while the FindString function is case
sensitive.
Example
STRCSPN(x, y): Returns the length of the initial segment of the string (x) consisting of
characters NOT in the string (y)
Example
Example
STRSPN(x, y): Returns the length of the initial segment of the string [x] consisting of
characters in the string [y]
Example
Example
Example
Trim(x, y): Removes the character(s) in the string y from the ends of the string x. Y is
optional and defaults to trimming white space. Notice in the TRIM function examples the
specified characters are trimmed. It doesn't matter what order the characters are in.
Example
TrimLeft(x, y): Removes character in the string y from the beginning of the string x.
Y is optional and defaults to trimming white space
Example
TrimLeft("** special invitation ", " *") returns "special invitation "
TrimRight(x, y): Removes character in the string y from the end of the string x. Y is
optional and defaults to trimming white space
Example
While you may be passing in a string of characters to trim, the TRIM functions do not
respect the order of the characters; it treats the string as a "list." Therefore it will trim
ALL of the characters in the list. If you are looking to replace a string, use a REPLACE
function or a REGEX function in your expression.
Uppercase(x)
About Length and Strings: When referencing the LENGTH of a string the first character
is counted as 1 (the length of the following string "record" is 6).
HOWEVER, when referencing the character position within a STRING, positions are
actually counted BETWEEN characters. So think of the first character's position as
0. Therefore, the position of the letter "c" in the string "record" is at position 2.
Example
Example