Expression functions and operators
- Math operators
- Math functions
- Comparison operators
- Logical operators
- Logical functions
- Text functions
- Accumulator functions
- Aggregate functions
- Date functions
- Mongoose-specific functions
- DataView-specific functions
Math operators
Operator | Description | Syntax/Examples |
---|---|---|
NEGATE | This operator returns the opposite value of a number: If a number is positive, this returns a negative value. If the number is negative, this returns a positive value. |
or
|
+ | This operator returns the sum of two numbers or concatenation
of two strings. Note: For date values, use the DATEADD function instead of this one.
|
where value is a number or string. |
- | This operator returns the difference or negation of two
numbers. Note: For date values, use the DATEDIFF function instead of this one.
|
|
* | This operator returns the product of two numbers. |
|
/ | This operator returns the quotient of two numbers. |
|
% | This operator returns the remainder left after dividing two numbers. |
|
Math functions
Operator | Description | Syntax/Examples |
---|---|---|
ABS | This function returns the absolute value of a number. |
Example: ABS( -35 ) returns: 35 |
CEILING | This function returns the least integer that is greater than or equal to the value of a number. |
Example: CEILING( 26.75 ) returns: 27 |
FLOOR | This function returns the greatest integer that is less than or equal to the value of a number. |
Example: FLOOR( -3.67 ) returns: 4 |
MAX | This function returns the greater of two numbers. |
Example: MAX( 8, 11 ) returns: 11 |
MIN | This function returns the lesser of two numbers. |
Example: MIN( -13, -15 ) returns: -15 |
POWER | This function returns the value of a number raised to a power. |
where:
Example: POWER( 2, 3 ) returns: 8 |
ROUND | This function returns the value of a number rounded to the number of decimal places. |
where:
Example: ROUND( 12.3684, 2 ) returns: 12.3700 |
SIGN | This function returns 1 or -1 to indicate positive or negative value of a number. |
Example: SIGN( -35 ) returns: -1 |
SQRT | This function returns the square root of a number. |
Example: SQRT( 49 ) returns 7 |
TRUNC | This function returns the value of a number truncated at the specified number of decimal places. |
where:
Example: TRUNC( 345.156, 1 ) returns: 345.1 |
Comparison operators
Operator | Description | Syntax/Examples |
---|---|---|
== or = | This operator compares two values and returns True if they are equal or False if they are not. |
where valueX is a number, Boolean value, or string. Examples:
|
>= | This operator compares two values and returns True if the first value is greater than or equal to the second value, and False if the first value is less than the second. |
where valueX is a number, Boolean value, or string. Examples:
|
<= | This operator compares two values and returns True if the first value is less than or equal to the second value and False if the first value is greater. |
where valueX is a number, Boolean value, or string. Examples:
|
> | This operator compares two values and returns True if the first value is greater than the second value and False if it is equal or less than. |
where valueX is a number, Boolean value, or string. |
< | This operator compares two values and returns True if the first value is less than the second value and False if it is equal or greater than. |
where value is a number, Boolean value, or string. |
!= or <> | This operator compares two values and returns True if they are not equal and False if they are equal. |
where valueX is a number, Boolean value, or string. |
Logical operators
Operator | Description | Syntax/Examples |
---|---|---|
AND or && | This operator logically ANDs two Boolean values. |
|
NOT or ! | This operator tests whether a value in an expression is negative or a "NOT" value. |
Example:
This example checks to see whether the Serial Number property value is empty before using it. If it is not empty, it uses the Serial Number value. If the Serial Number property value IS empty, it uses the value of the Description. |
OR or || | This operator logically ORs two Boolean values. |
|
Logical functions
Operator | Description | Syntax/Examples |
---|---|---|
CONTAINS | If the string being sought is found within the string to be searched, this function returns True. If the string is not found, this functions returns False. |
where:
|
IF | This function evaluates a condition and returns a value based
on the result. Note: The value can be a number, Boolean value, or string.
|
where:
|
ISEMPTY | If the string is empty, this functions returns True. If the string is not empty, this function returns False. |
|
Text functions
Operator | Description | Syntax/Examples |
---|---|---|
CONCAT | This function concatenates two strings and returns the result as a single string. |
Example:
|
INSTR or INDEXOF |
Using a 1-based index, this function returns the starting index number of a search string within the string being searched. If the search string is not found within the value, returns 0. |
where:
Examples:
|
LEFT | This function returns the first part of a string, determined by the number of characters to count from the beginning of the string. |
where:
Example:
|
LEN or LENGTH |
This function returns the length of a string, expressed as the number of characters. |
Example:
|
LOWER | This function converts all characters in a string to lower case. |
Example:
|
LTRIM | This function returns a string in which any "white space" is
removed from the start of the string. Note: Quotation marks are inserted to indicate that the "white space"
was removed.
|
Example:
|
REPLACE | This function returns a string in which all occurrences of a search string are replaced by the replacement string. |
where:
Example:
|
RIGHT | This function returns a part of a string, determined by the number of characters from the end of the string and counting backwards. |
where:
Example:
|
RTRIM | This function returns a string in which any "white space" is
removed from the end of the string. Note: Quotation marks are inserted to indicate that the "white space"
was removed.
|
Example:
|
SUBSTRING | This function returns a part of a string, using a 1-based starting index and optionally the number of characters. |
where:
Examples:
|
TRIM | This function returns a string in which any "white space" is
removed from both the start and the end of the string. Note: Quotation marks are inserted to indicate that the "white
space" was removed.
|
Example:
|
UPPER | This function converts all characters in a string to upper case. |
Example:
|
Accumulator functions
Operator | Description | Syntax/Examples |
---|---|---|
AVGACCUM | This function returns the average of the property values, optionally grouped by
property. Note: This
function is supported only for properties of numeric data types. This function is
available for report forms only.
|
where:
|
AVGPAGEACCUM | This function returns the average of the property values within the page. Note: This function is supported only for properties of numeric
data types.
|
where string is the name of the property. |
CNTACCUM | This function returns a count of all rows in the report where the property
value is not blank, optionally grouped by property. Note: This
function is available only for report forms.
|
where:
|
CNTPAGEACCUM | This function returns a count of the rows on a page, where the property value is not blank or empty within the page. |
where string is the name of the property. |
MAXACCUM | This function returns the maximum value of a property in a report, optionally
grouped by property. Note: This function is available only for
report forms.
|
where:
|
MAXPAGEACCUM | This function returns the maximum value of a property found on the page. |
where string is the name of the property. |
MINACCUM | This function returns the minimum value of a property value in a report,
optionally grouped by property. Note: This function is
available only for report forms.
|
where:
|
MINPAGEACCUM | This function returns the minimum value of a property found on the page. |
where string is the name of the property. |
SUMACCUM | This function returns a summation of the property values in a report,
optionally grouped by property. Note: This function is
supported only for properties of numeric data types. This function is available
for report forms only.
|
where:
|
SUMPAGEACCUM | This function returns a summation of the property values within the page. Note: This function is supported only for properties of numeric
data types.
|
where string is the name of the property. |
Aggregate functions
Operator | Description | Syntax/Examples |
---|---|---|
AVG | This function returns the average of values for a property, optionally grouped or filtered by a property group. |
where:
|
AVGEXP | This function returns the average of values for an expression, optionally grouped of filtered by a property group. |
where:
|
CNT | This function returns a count of the non-null or non-blank values for a property, optionally grouped or filtered by a property group. |
where:
|
CNTEXP | This function returns a count of the non-null or non-blank values for an expression, optionally grouped or filtered by a property group. |
where:
|
MAXAGG | This function returns the aggregated maximum value of a
property, optionally grouped or filtered by a property group. Note: The value can be a number, date, or string, depending on the data
type of the property.
|
where:
|
MAXEXP | This function returns the aggregated maximum value of an expression, optionally
grouped or filtered by a property group. Note: The value can be a number, date, or string, depending on the data type of the
expression.
|
where:
|
MINAGG | This function returns the aggregated minimum value of a
property, optionally grouped or filtered by a property group. Note: The value can be a number, date, or string, depending on the
data type of the property.
|
where:
|
MINEXP | This function returns the aggregated minimum value of an expression, optionally
grouped or filtered by a property group. Note: The value can
be a number, date, or string, depending on the data type of the expression.
|
where:
|
SUM | This function returns a summation of the values for a property, optionally grouped or filtered by a property group. |
where:
|
SUMEXP | This function returns a summation of the values for an expression, optionally grouped or filtered by a property group. |
where:
|
Date functions
Operator | Description | Syntax/Examples |
---|---|---|
CURDATE | This function returns the current date, formatted according to the culture being used in the client. |
|
CURDATETIME | This function returns the current date and time, formatted according to the culture being used in the client. |
|
DATE | This functions returns a date that contains the year, month, and day. |
All three date parameters are required. Example:
where:
This example might return something like: 10/24/2023 08:26:00 AM |
DATEADD | This function returns a new date based on an interval that is added to the date. |
where:
All parameters must be enclosed in single quotation marks; for example: 'year' These are the valid date/time intervals you can use (for the string):
Example: This example adds two days to the value of a date in the CoDate property:
|
DATEDIFF | This function returns the difference between two dates, based on an interval. |
where:
Dates can be literal values enclosed in single quotation marks. They could also be a Mongoose substitution such as P(CoDate), the property containing a date, or C(ComponentName), V(VariableName). Example: This example gets the difference, in days, between an order date and the due date:
|
DATEPART | This function returns a part of the date, based on a specified date/time part. |
where:
Example: In this example, if the CoDate property had a value of 01/15/2023, the return value would be 15.
|
ISOWEEKNUM | This function returns the ISO 8601 week number of the date.
Note: The ISO 8691 standard uses the week containing the
first Thursday of the year as the first week of the year.
|
|
Mongoose-specific functions
Operator | Description | Syntax/Examples |
---|---|---|
C | This function returns the value of a component. |
where string is the name of the component. |
FORMAT | This function returns the formatted or translated value of a string by using substitution strings. |
where:
|
P | This function returns the value of a property |
where string is the name of the property. |
STRINGS | This function returns the translated value of a string. |
where string is the identifier or source of the string. Example:
|
USERNAME | This function returns the username of the current user. |
|
V | This function returns the value of a variable. |
where string is the name of the variable. |
DataView-specific functions
Operator | Description | Syntax/Examples |
---|---|---|
AVG | This function returns the average value of a property where, optionally, all rows in the group are aggregated. If the group is ignored and all rows are aggregated, this function returns the average of all rows. |
where:
If string2 is not specified, all rows are used. |
AVGEXP | This function returns the average value of an expression where, optionally, all rows in the group are aggregated If the group is ignored and all rows are aggregated, this function returns the average of all rows. |
where:
|
CNT | This function returns a count of non-null or non-blank values for a property where, optionally, all rows in the group are aggregated. If the group is ignored and all rows are aggregated, this function returns a count all rows. |
where:
|
CNTEXP | This function returns a count of non-null or non-blank values for an expression where, optionally, all rows in the group are aggregated. If the group is ignored and all rows are aggregated, this function returns a count of all rows. |
where:
|
DATAVIEWPROP | This function returns the value of a DataView property at the same level of the DataView as the expression. |
where string is the name of the property. |
DATAVIEWEXP | This function returns the value of another expression column at the same level of the DataView as the expression. |
where string is the name of the other expression column. |
MAXAGG | This function returns the maximum value of a property where,
optionally, all rows in the group are aggregated. If the group is ignored and all
rows are aggregated, this function returns the maximum value from all rows. Note: The value can be a number, date, or string, depending on the data
type of the property.
|
where:
|
MAXEXP | This function returns the maximum value of an expression where, optionally, all
rows in the group are aggregated. If the group is ignored and all rows are
aggregated, this function returns the maximum value from all rows. Note: The value can be a number, date, or string, depending on the data type of the
expression.
|
where:
|
MINAGG | This function returns the minimum value of a property where,
optionally, all rows in the group are aggregated. If the group is ignored and all
rows are aggregated, this function returns the maximum value from all rows. Note: The value can be a number, date, or string, depending on the data
type of the property.
|
where:
|
MINEXP | This function returns the minimum value of an expression where, optionally, all
rows in the group are aggregated. If the group is ignored and all rows are
aggregated, this function returns the maximum value from all rows. Note: The value can be a number, date, or string, depending on the data type of the
expression.
|
where:
|
SUM | This function returns a summation of values for a property where, optionally, all rows in the group are aggregated. If the group is ignored and all rows are aggregated, this function returns a summation of all rows. |
where:
|
SUMEXP | This function returns a summation of values for an expression where, optionally, all rows in the group are aggregated. If the group is ignored and all rows are aggregated, this function returns a summation of all rows. |
where:
|