This list is valid ONLY for direct Datamart / Data Source queries, not for cached (table context) tables queries. For cached tables we use the H2 database which has a slightly different syntax.
Expressions
-
The expression string supports:
-
Variables and functions
-
Number expressions (resulting in either an Integer or BigDecimal, but not double/float)
-
String expressions
-
-
Literal strings have to be quoted using the double quotes (")
-
Supported operators are:
( ) + - * / ^ and or < <= > >= = <> % not inv
The + operator can be used for the concatenation (i.e., "a" + "b" -> "ab") in Data Source and Datamart field expressions. It is not applicable as an expression within Charts.
General Functions
|
Function |
Description |
|---|---|
|
|
Returns a Boolean value indicating whether a specified expression contains no valid data (null). |
|
|
Evaluates a condition. Argument2 and 3 have to have the same data type. Sample SQL: |
|
|
Example:
When used in filters with an expression such as However, if you modify the filter to use |
|
|
Returns the first expression if the two expressions are not equal. This function is used, for example, to calculate an average price and to prevent division by zero errors. Example 1 : If the Example 2: |
|
|
Performs division while safely handling zero or null denominators. This function is available in Agents, Analytics charts, and Rollups. All arguments must be numeric. Variants
Returns: Returns: |
|
|
|
|
|
|
|
|
Argument1 is literal, argument2 is literal string, e.g. "STRING". For argument2, allowed values are: STRING, NUMBER, DATE, BOOLEAN, DATETIME, LOB, LONG |
|
|
An SQL query with formula: |
|
|
The nearest integer greater than or equal to the argument. |
|
|
The nearest integer less than or equal to the argument. |
|
|
Rounds to the specified number of decimals: round(42.4382, 2) = 42.44 |
Aggregation Functions for Group By
|
Function |
Description |
|---|---|
|
|
Sum of the expression across all input values. |
|
|
Average of the expression across all input values. |
|
|
Calculates the weighted average of
Both arguments must be numeric.
|
|
|
Minimum value of the expression across all input values. |
|
|
Maximum value of the expression across all input values. |
|
|
Number of input rows for which the value of the expression is not null. |
|
|
Number of all distinct non-null values specified by the expression. |
|
|
Returns true if the expression is true for all input values; otherwise returns false. |
|
|
Returns true if the expression is true for at least one input value; otherwise returns false. |
|
|
Returns an arbitrary value from the group. There is no guarantee which specific value is returned if multiple values exist. If the group contains |
|
|
|
|
|
|
Statistical Aggregation Functions
|
Function |
Description |
|---|---|
|
|
Correlation coefficient |
|
|
Population covariance |
|
|
Sample covariance |
|
|
Average of the independent variable (sum(X)/N) |
|
|
Average of the dependent variable (sum(Y)/N) |
|
|
Number of input rows in which both expressions are non-null |
|
|
Y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs |
|
|
Square of the correlation coefficient |
|
|
Slope of the least-squares-fit linear equation determined by the (X, Y) pairs |
|
|
Sum(X^2) - sum(X)^2/N ("sum of squares" of the independent variable) |
|
|
Sum(X*Y) - sum(X) * sum(Y)/N ("sum of products" of independent times dependent variable) |
|
|
Sum(Y^2) - sum(Y)^2/N ("sum of squares" of the dependent variable) |
|
|
Population standard deviation of the input values |
|
|
Sample standard deviation of the input values |
|
|
Population variance of the input values (square of the population standard deviation) |
|
|
Sample variance of the input values (square of the population standard deviation) |
Functions Used Within Groups
|
Function |
Description |
|---|---|
|
|
Relative rank of the current row: (rank - 1) / (total rows - 1) |
|
|
Relative rank of the current row: (number of rows preceding or peer with current row) / (total rows) |
|
|
|
|
|
|
|
|
|
|
|
|