OPAL Numeric Functions¶

Numeric functions act on and/or produce numeric values, for your mathematical calculation needs.

Function

Description

abs

Returns the absolute value of ‘val’.

avg

Calculate the arithmetic average of the input expression across the group, or of the scalar arguments if more than one.

ceil

Returns ‘val’ rounded up to the given ‘precision’.

count

Count the number of non-null items in the group.

delta

Calculates the value difference of the argument in each time bin for each group.

delta_monotonic

Calculates the amount of difference in a column in each time bin for each group.

dense_rank

Returns the dense rank within an ordered group of values.

deriv

Calculate the average per-second derivative of the argument across the group.

exp

Returns Euler’s number e raised to the given number.

float64_null

Returns a null value of type float64.

floor

Returns ‘val’ rounded down to the given ‘precision’.

haversine_distance_km

Computes the great circle approximate distance between two latitude/longitude coordinates, using the haversine formula.

int64_null

Returns a null value of type int64.

int_div

Returns the integer quotient of the dividend divided by the divisor and truncates the remainder.

ln

Returns natural logarithm of a numeric expression.

log

Returns logarithm of a numeric expression (second argument) with the provided base (first argument).

median

Return the fast approximate median value of one column.

median_exact

Return the exact median value of one column.

mod

Returns the remainder when dividend is divided by the divisor.

percentile

Returns an approximated value for the specified percentile of the input expression across the group.

percentile_cont

Assuming a continuous distribution, return the value for the specified percentile of the input expression across the group.

percentile_disc

Assuming a discrete distribution, return the value for the specified percentile of the input expression across the group.

pow

Returns a number ‘base’ raised to the specified power ‘exponent’.

prom_quantile

Calculates an approximate percentile value of the distribution in a histogram metric generated by a Prometheus data source.

rank

Returns the rank within an ordered group of values.

rate

Calculate the average per-second rate of the argument across the group.

round

Returns ‘val’ rounded to the given ‘precision’.

row_number

Return the window index of the row within its groupby, when ordered by the orderby.

sqrt

Returns the square root for a given input and null if input is negative.

stddev

Calculate the standard deviation across the group.

sum

Calculate the sum of the argument across the group, or of the scalar arguments if more than one.

uniform

Generates a uniformly-distributed pseudo-random number in the inclusive range [`min`, `max`].

width_bucket

Construct equi-width histogram by dividing up the range between `min` and `max` with `num_buckets` buckets, and compute an integer

zipf

Returns a Zipf-distributed integer, for N elements and characteristic exponent s.