Evaluate Expression

  • Perform complex mathematical or textual operations, for example:

    • Evaluate the expression: 15*16*2

    • Result = 480

  • Evaluate the validity of complex mathematical or logical expressions to obtain a result of True or False, for example:

    • Evaluate the expression: 15*16*2 = 500

    • Result = False

  1. Enter the operation you want to perform or the expression you want to evaluate for validity

  2. Enter the name of the variable in which you'd like to place the result

Constants

  • To utilize a text string as a constant, place it within single quotes, for example: 'Franklin D. Roosevelt'

    • If the text string includes a single quote, precede it with another single quote, for example: 'Franklin D. Roosevelt''s New Deal'

  • To utilize a numeric constant, simply enter the number without any additional characters, for example: 10000

    • Exception: To treat a number as a text string (as opposed to a number), place it within single quotes

    • Decimals are supported within numeric values, for example: 3.141519

    • Commas and currency characters are not supported within numeric values

Variables

  • To utilize a variable as text string, place the variable name within dollar signs, for example: $TextVariable$

  • To utilize a variable as a numeric value, place the variable name within number signs, for example: #NumericVariable#

Operators

Supported arithmetic operators:

  • + (addition)

  • - (subtraction)

  • * (multiplication)

  • / (division)

  • % (modulus)

returns the remainder obtained when dividing the first value by the second

Standard mathematical order of operations applies. Use parentheses to force order of precedence. For example:

  • 120/10 + 2 = 14

  • 120/(10+2) = 10

Supported Boolean operators:

  • AND

  • OR

Supported comparison operators:

  • = (equals)

  • <> (does not equal)

  • < (is less than)

  • > (is greater than)

  • <= (is less than or equal to)

  • >= (is greater than or equal to)

  • LIKE (similar to equals, but permits the use of wildcard characters)

    • Valid wildcard characters are * and % (and can be used interchangeably)

      • If the string in a LIKE clause contains a * or %, those characters should be enclosed in brackets, for example: 25[%]

      • If a bracket is in the clause, each bracket character should be enclosed in brackets, for example: [[] or []]

    • A wildcard is allowed at the start of a pattern, the end of a pattern, or both. For example:

      • $name$ LIKE 'Franklin*' returns True when name = Franklin D. Roosevelt

      • $name$ LIKE '*Franklin' returns True when name = Benjamin Franklin

      • $name$ LIKE '*Franklin*' returns True when name = John Adams & Benjamin Franklin signed the Declaration of Independence

    • A wildcard is not allowed in the middle of a pattern, for example: $name$ LIKE 'Fran*lin'

Letter case is not considered when expressions are evaluated for validity. For example: $name$ = 'franklin' returns True when name = Franklin

String operator:

  • Use the + character to concatenate a text string. For example, 'Benjamin' + ' ' + $lastname$ returns Benjamin Franklin when lastname = Franklin

Concatenation & order of precedence:

  • You can create complex expressions by concatenating clauses using the AND and OR operators

    • The AND operator has precedence over other operators

    • You can use parentheses to group clauses and force precedence, for example: ($firstname$ = 'Theodore' OR $firstname$ = 'Franklin') AND $lastname$ = 'Roosevelt'

Functions

LEN

Description

Gets the length of a string (including spaces)

Syntax

LEN(expression)

Arguments

expression = the string to be evaluated

Example

LEN($name$) returns21when name = Franklin D. Roosevelt

IIF

Description

Gets one of two values depending on the result of a logical expression

Syntax

IIF(expression, if_true, if_false)

Arguments

expression = the expression to evaluate

if_true = the value to return if the expression is true

if_false = the value to return if the expression is false

Example

IIF(#year# = 1776, 'Benjamin Franklin', 'Franklin D. Roosevelt') returns Franklin D. Roosevelt when year = 1948

TRIM

Description

Removes blank spaces (including <Space> <Tab> and <Enter>) from both ends of an expression

Syntax

TRIM(expression)

Arguments

expression = the expression to trim

Example

TRIM($name$) returnsTheodore Rooseveltwhen

name = <Space><Tab>Theodore Roosevelt<Enter>

SUBSTRING

Description

Gets a substring of a specified length, starting at a specified point in the string

Syntax

SUBSTRING(expression, start, length)

Arguments

expression = the source string

start = the numbered position that the substring starts (within the source string)

length = the length of the desired substring

Example

SUBSTRING($trivia fact$,13,28) returnsRoosevelt died in April 1945when trivia fact = Franklin D. Roosevelt died in April 1945, before the end of WWII.