User Guide
×
Menu
Index
 

Functions and Operators

 
Below is a list of functions and operators that you can use in expressions.
 
   
Category
Operator/Function
Type
Description
Result
String
+
operator
expr1 + expr2
Results in string created from concatenating strings expr1 and expr2 or numerical value from adding values. Expr1 and expr2 must be of the same type.
type of expr1
 
UCASE
function
UCASE(expr1)
Upper case of string.
string
 
LCASE
function
LCASE(expr2)
Lower case of string.
string
 
LEFT
function
LEFT(expr1, expr2)
First expr2 characters of string expr1. Expr2 must be a non-negative number.
string
 
RIGHT
function
RIGHT(expr1, expr2)
Last expr2 characters of string expr1. Expr2 must be a non-negative number.
string
 
MID
function
MID(expr1, expr2, expr3)
Expr3 characters from string expr1, starting at character expr2 (1-based). Expr2 and expr2 must be non-negative numbers.
string
 
LENGTH
function
LENGTH(expr1)
Number of characters in string expr1.
number
 
REPLACE
function
REPLACE(expr1, expr2, expr3)
Returns a string derived from expr1 in which any occurrences of substring expr2 are replaced with string expr3.
All expr1, expr2 and expr3 are expected to be strings.
string
 
FIND
function
FIND(expr1, expr2)
Returns a position (1-based) at which first occurrence of string expr2 is found in string expr1, or 0 if expr2 is not found in expr1.
Expr1 and expr2 must be strings.
number
 
SPLIT
function
SPLIT(expr1, expr2)
Returns a list of values created by splitting string expr1 into pieces separated by string expr2.
array of strings
 
CONCAT
function
CONCAT(expr1, expr2)
String created from concatenating strings expr1 and expr2.
string
Math
-
operator
expr1 - expr2
Expr1 minus expr2. Both values must be numeric. If any of the values is missing then the result is also MISSING.
number
 
*
operator
expr1 * expr2
Expr1 multiplied by expr2. Both values must be numeric. If any of the values is missing then the result is also MISSING.
number
 
/
operator
expr1 / expr2
Expr1 divided by expr2. Both values must be numeric. If any of the values is missing then the result is also MISSING.
number
 
^
operator
expr1 ^ expr2
Expr1 to the power of expr2. Both values must be numeric. If any of the values is missing then the result is also MISSING.
number
 
ABS
function
ABS(expr1)
Absolute value of expr1. Input value must be numeric. If input value is missing then result is also MISSING.
number
 
ROUND
function
ROUND(expr1, expr2)
Rounds number to a given number of decimals (in a "away-from-zero" rounding mode). Expr1 must be a number, expr2 must be a number (can be negative).
number
Comparison
==
operator
expr1 == expr2
TRUE if the two values are equal. Comparison which involves any MISSING value always returns FALSE. Only values of the same type can be compared against each other. When strings are being compared, the comparison is case sensitive and accent sensitive.
boolean
 
!=
operator
expr1 != expr2
TRUE if the two values are not equal. Comparison which involves any MISSING value always returns FALSE. Only values of the same type can be compared against each other. When strings are being compared, the comparison is case sensitive and accent sensitive.
boolean
 
>
operator
expr1 > expr2
TRUE if the first value is greater than the other. Comparison which involves any MISSING value always returns FALSE. When strings are being compared, the comparison is case sensitive and accent sensitive.
boolean
 
<
operator
expr1 < expr2
TRUE if the first value is smaller than the other. Comparison which involves any MISSING value always returns FALSE. When strings are being compared, the comparison is case sensitive and accent sensitive.
boolean
 
>=
operator
expr1 >= expr2
TRUE if the first value is equal to or greater than the other value. Comparison which involves any MISSING value always returns FALSE. When strings are being compared, the comparison is case sensitive and accent sensitive.
boolean
 
<=
operator
expr1 <= expr2
TRUE if the first value is equal to or smaller than the other value. Comparison which involves any MISSING value always returns FALSE. When strings are being compared, the comparison is case sensitive and accent sensitive.
boolean
 
ISMISSING
function
ISMISSING(expr1)
Returns TRUE or FALSE depending on whether expr1 evaluates to a MISSING value.
boolean
Logical
AND
operator
expr1 AND expr2
TRUE if both expr1 and expr2 are TRUE. Otherwise FALSE.
boolean
 
OR
operator
expr1 OR expr2
TRUE if at least one of expr1, expr2 is TRUE. Otherwise FALSE.
boolean
 
NOT
operator
NOT expr1
TRUE if expr1 is FALSE. Otherwise FALSE.
boolean
Multi-value
COUNT
function
COUNT(expr1)
Number of items within a list (e.g., of string) or number of rows within a table.
number
 
JOIN
function
JOIN(expr1, expr2,<optional>property)
Expr1 might be either a list of values or a table.
If expr1 is a list of values, then it will return a string value which is created from concatenating all values within expr1, separated with expr2.
If expr1 is a table it will return table results (specified by property: id, label, value - [optional] default is label) as string concatenated by join_string.
string
 
ITEMAT
function
ITEMAT(expr1, expr2, <optional>property)
Expr1 might be either a list of values or a table. Expr2 is non-negative number.
If expr1 is a list of values then it will return a value from a given position inside a list of values (1-based).
If expr1 is a table then it will return the value of row (its specified property: id, label, value - [optional] default is label) at specified position in a table (1-based).
type of property
 
POSITIONOF
function
POSITIONOF(expr1, expr2, <optional>property)
Returns position (1-based) of specified value (expr2) taken from row property ([optional] default is label)in table (expr1) . Returns MISSING if expr2 does not exist in a given table.
number
 
CONTAINS
function
CONTAINS(expr1, expr2)
Expr1 might be either a list of values or a table.
Expr1 is expected to be a multichoice value while expr2 is expected to be a string. Returns true if multivalue expr1 contains item with label equal expr2.
boolean
 
MIN
function
MIN(expr1)
Returns minimum value from table results.
number
 
MAX
function
MAX(expr2)
Returns maximum value from table results.
number
 
RANKOF
function
RANKOF(expr1, expr2, <optional>sortDirection, <optional>rounding, <optional>dense)
Returns rank of specified value (expr) in table (expr1) with optional parameters: sort_order: Ascending/Descending (default); decimal_places: default 8 (number required); dense: On/Off (default). Optional properties need to be in the specified order.
number
 
ASTABLE
function
ASTABLE("id", "label", value)
Create table definition from inputs.
table
 
ARITHMAVG
function
ARITHMAVG(expr1)
Returns the arithmetic average of all values from the table.
number
 
SUM
function
SUM(expr1)
Returns sum of the table values.
number
 
UNION
function
Union(table1, table2, ...)
Concatenate table together.
table
 
HEAD
function
Head(table, expr2)
Gets first expr2 items from the table.
table
 
TAIL
function
TAIL(table,expr2)
Gets last expr2 items from the table.
table
 
SKIP
function
Skip(table, 2)
Gets all items from the table, ignoring first 'n' items.
table
 
FILTER
function
Filter(table, @calcValue > 10)
Create a subset based on expression.
table
 
SORT
function
Sort(table, @CalcValue, @Asc)
Sort list based on expression.
table
Value
TRUE
constant
TRUE
TRUE value.
boolean
 
FALSE
constant
FALSE
FALSE value.
boolean
 
MISSING
constant
MISSING
MISSING value.
boolean
Control flow
IFELSE
function
IFELSE(expr1, expr2, expr3)
Returns expr2 if expr1 is TRUE and returns expr3 if expr1 is FALSE or MISSING.
Expr1 must be a logical expression. Expr2 and Expr3 must be of same type.
type of (expr2)
Conversion
TONUMBER
function
ToNumber(expr1)
Converts string to a number.
number
 
TOSTRING
function
ToString(expr1, expr2)
Formats number to a string. Expr1 must be a number to be formatted, expr2 must be a string representing the desired format (e.g. "#,##0,00", "0.0%")
string
Context
SLIDESETTING
function
SlideSetting(@nameOfTheSetting)
Returns the currently selected value of the specified page setting.
string
 
PARAMETERVALUE
function
ParameterValue(@nameOfParameter)
Returns the currently selected value of the specific page parameter.
string
 
AUTHOR
function
Author(@attribute)
Returns a specific attribute (e.g., display name or email address) of the user who is the author of the page.
string
 
DATAREFERENCE
function
DataReference(@nameOfReference, @nameOfProperty)
Returns information retrieved from a specific cell of a calculation table, as given by the reference. Depending on chosen @nameOfProperty the information can represent actual cell value (numeric), cell value formatted into string, indication of footnote reference(s) or actual footnote text(s). Response labels are also supported.
type of property
 
TABREFERENCE
function
TabReference(@tab, @question1, @answer1, @question2, @answer2, ..., @statistic, <optional>@property)
Returns information retrieved from a specific cell(s) of a query from @tab. For each @question it is possible to retrieve data for specific @answer or use one of the *All tags to retrieve a table with e.g., all responses. Instead of pointing to an answer(s) directly, it is possible to use integer values as @answer property. Positive integers will return an item at x position from the top of the table, negative (-x) - from the bottom of the table. Depending on chosen @property (optional parameter with "Value" as default), the information can represent actual statistic value (numeric), statistic value formatted into string, indication of a footnote reference(s) or an actual footnote text(s). Significant difference and response labels are also supported.
type of property
 
ROWNUMBER
function
RowNumber()
Returns position of current row within the whole grid widget.
number
 
ROWPROPERTY
function
RowProperty(@property)
Returns a selected property e.g., id, label or value from row expression result.
type of property
 
COLNUMBER
function
ColNumber()
returns position of current column within the whole grid widget.
number
 
COLPROPERTY
function
ColProperty(@property)
Returns a selected property e.g., id, label or value from column expression result.
type of property