Number Processing Functions
This section describes expression language functions related to processing integer and floating point numbers.
Function | Description | Result Type | Backend Support | Frontend Support |
abs(Double value) | Returns the absolute value of a value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned. If argument type is Integer or Long, return value is Long. | Double | Yes | Yes |
acos(Double value) | Returns the arc cosine of an angle, in the range of 0.0 through pi. | Double | Yes | Yes |
asin(Double value) | Returns the arc sine of an angle, in the range of -pi/2 through pi/2. | Double | Yes | Yes |
atan(Double value) | Returns the arc tangent of an angle, in the range of -pi/2 through pi/2. | Double | Yes | Yes |
average(DataTable | Number value1 [, DataTable | Number value2, ...]) | Calculates the arithmetic mean of a set of values, including all cells of provided tables. Non-numeric values are skipped. | Double | Yes | No |
averagea(DataTable | Number value1 [, DataTable | Number value2, ...]) | Calculates the arithmetic mean of a set of values, including all cells of provided tables. Non-numeric values are converted into numbers. | Double | Yes | No |
averageIf(DataTable table1, String condition1 [, DataTable table2, String condition2, ...]) | Checks each of the provided tables to calculate an average of numeric values that match conditions. A condition is an expression that may refer to the value being checked using “value” environment variable, i.e. via | Double | Yes | No |
avg(DataTable table, String field) | Returns the arithmetic mean of the numbers from a field in table. Target field name is specified by field. | Double | Yes | Yes |
cbrt(Double value) | Returns the cube root of a value. | Double | Yes | Yes |
ceil(Double value [, Double significance]) | Rounds value up to the nearest integer. If significance is specified, rounds up to the nearest integer multiple of this significance. | Double | Yes | Limited |
cos(Double value) | Returns the trigonometric cosine of an angle. Angle is measured in radians. | Double | Yes | Yes |
cosh(Double value) | Returns the hyperbolic cosine of a value. | Double | Yes | Yes |
e() | Returns the base of the natural logarithms. | Double | Yes | Yes |
eq(Long first, Long second) | Returns true if first argument is equal to the second argument (same as == operator). | Boolean | Yes | Yes |
exp(Double value) | Returns Euler's number e raised to the power of value. | Double | Yes | Yes |
floor(Double value [, Double factor [, Integer mode]]) | Rounds value down to the nearest integer. If significance is specified, rounds down to the nearest integer multiple of this significance. If mode is specified and it's not equal to zero, negative values are rounded up towards zero. | Double | Yes | Limited |
formatNumber(Number number, String pattern) | Formats argument number according to the formatting defined by string. Number formatting patterns are described here. | String | Yes | Yes |
frequency(DataTable table [, String field]) | Returns a table indicating the frequency of the numbers from a field in table. Target field name is specified by the field parameter, if no field is provided then the first field is used. Any floating point values are converted to integers for comparison. Returns data table with fields:
| Data Table | Yes | Yes |
ge(Long first, Long second) | Returns true if first argument is greater or equal than second argument (same as >= operator). | Boolean | Yes | Yes |
gt(Long first, Long second) | Returns true if first argument is greater than second argument (same as > operator). | Boolean | Yes | Yes |
large(DataTable table, Integer k) | Returns the k-th largest value found in the cells of table. All values in the table are converted to numbers besides null values that are skipped. | Double | Yes | No |
le(Long first, Long second) | Returns true if first argument is less or equal than second argument (same as <= operator). | Boolean | Yes | Yes |
linearRegression(Data Table table, String xSeriesFieldName, String ySeriesFieldName) | Returns data table containing a linear regression model calculated on values from table. The arguments xSeriesFieldName and ySeriesFieldName are the names of the fields in the data table to use for the X values and Y values in the regression calculation. Returns data table with fields:
| Data Table | Yes | Yes |
log(Double value) | Returns the natural logarithm (base e) of a value. | Double | Yes | Yes |
log10(Double value) | Returns the base 10 logarithm of a value. | Double | Yes | Yes |
lt(Long first, Long second) | Returns true if first argument is less than second argument (same as < operator). | Boolean | Yes | Yes |
max(DataTable table, String field) max(DataTable | Number value1 [, DataTable | Number value2, ...]) | Returns the largest value in a table field or in a list of values that may include tables. In the second case each numeric cell of each provided table is checked. | Double | Yes | Limited |
median(DataTable table [, String field]) median(DataTable | Number value1 [, DataTable | Number value2, ...]) | Returns the median value in a table field or in a list of values that may include tables. In the second case each numeric cell of each provided table is included into calculation. | Double | Yes | Limited |
min(DataTable table, String field) min(DataTable | Number value1 [, DataTable | Number value2, ...]) | Returns the smallest value in a table field or in a list of values that may include tables. In the second case each numeric cell of each provided table is checked. | Double | Yes | Limited |
mode(DataTable table, String field) mode(DataTable | Number value1 [, DataTable | Number value2, ...]) | Returns the mode for all numeric values of a table field or for a list of values that may include tables. In the second case each numeric cell of each provided table is included into calculation. | Double | Yes | Limited |
mround(Double value, Double multiple) | Rounds the value to the desired multiple. Rounding goes up, away from zero, if the remainder of dividing value by multiple is greater than or equal to half the value of multiple. Both arguments must have the same sign. | Double | Yes | No |
ne(Long first, Long second) | Returns true if first argument is not equal to the second argument (same as != operator). | Boolean | Yes | Yes |
parseNumber(String source, String pattern [, String decimalSeparator [, String groupSeparator]]) | Creates a number from a source string formatted according to the pattern. Patterns are described here. Uses custom decimal and digit group separator characters if provided. | Number | Yes | No |
pi() | Returns the ratio of the circumference of a circle to its diameter. | Double | Yes | Yes |
pow(Double base, Double power) | Returns the value of the first argument raised to the power of the second argument. | Double | Yes | Yes |
random() | Returns a value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range. | Double | Yes | Yes |
round(Double value [, Integer digits]) | Rounds a value to a specified number of digits, or to the closest integer if digits are not specified or zero. If digits is less than 0, the value is rounded to the left of the decimal point. | Long | Double | Yes | Limited |
roundDown(Double value [, Integer digits]) | Rounds a value down, towards zero. The value is rounded to a specified number of digits, or to the closest integer if digits is zero or not specified. If digits is less than 0, the value is rounded to the left of the decimal point. | Double | Yes | No |
roundUp(Double value [, Integer digits]) | Rounds a value up, away from zero. The value is rounded to a specified number of digits, or to the closest integer if digits is zero or not specified. If digits is less than 0, the value is rounded to the left of the decimal point. | Double | Yes | No |
signum(Double value) | Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero. If argument type is Integer or Long, return value is Long. | Double | Yes | Yes |
sin(Double value) | Returns the trigonometric sine of an angle. Angle is measured in radians. | Double | Yes | Yes |
sinh(Double value) | Returns the hyperbolic sine of a value. | Double | Yes | Yes |
sma(Data Table table, String field, Integer depth) | Returns a data table with the simple moving average calculated from the values in a field in table. Target field name is specified by field. The argument depth indicates how many previous values should be included in the average calculation window. Returns data table with fields:
| Data Table | Yes | Yes |
small(DataTable table, Integer k) | Returns the k-th smallest value found in the cells of table. All values in the table are converted to numbers besides null values that are skipped. | Double | Yes | No |
smm(Data Table table, String field, Integer depth) | Returns a data table with the simple moving median calculated from the values in a field in table. Field name is specified by field. The argument depth indicates how many previous values should be included in the median calculation window. Returns data table with fields:
| Data Table | Yes | Yes |
sqrt(Double value) | Returns the correctly rounded positive square root of a value. | Double | Yes | Yes |
standardDeviation(DataTable table [, String field]) | Returns the standard deviation calculated from the values in a field in table. Target field name is specified by the field parameter, if no field is provided then the first field is used. | Double | Yes | Yes |
standardError(DataTable table [, String field]) | Returns the standard error of the mean calculated from the values in a field in table. Target field name is specified by the field parameter, if no field is provided then the first field is used. | Double | Yes | Yes |
sum(DataTable table, String field) sum(DataTable | Number value1 [, DataTable | Number value2, ...]) | Returns the sum of all numeric values in a table field or in a list of values that may include tables. In the second case each numeric cell of each provided table is included into calculation. | Double | Yes | Limited |
sumIf(DataTable table1, String condition1 [, DataTable table2, String condition2, ...]) | Checks each of the provided tables to sum numeric values that match conditions. Returns the total sum. A condition is an expression that may refer to the value being checked using “value” environment variable, i.e. via | Double | Yes | No |
sumProduct(String operator, DataTable table1, DataTable table2 [, DataTable table3, ...]) | Calculates the sum of the products of corresponding cells in two or more equally sized tables. Product type is defined by the first parameter that can be set to "*" (multiplication), "/" (division), "+" (addition), and "-" (subtraction). | Double | Yes | No |
tan(Double value) | Returns the trigonometric tangent of an angle. Angle is measured in radians. | Double | Yes | Yes |
tanh(Double value) | Returns the hyperbolic tangent of a value. | Double | Yes | Yes |
variance(DataTable table [, String field]) | Returns the variance of the numbers from a field in table. Target field name is specified by field parameter, if no field is provided then the first field is used. | Double | Yes | Yes |
Was this page helpful?