Numeric Functions
Numeric functions perform mathematical, rounding, or computational operations on scalar numeric values.
They are used to calculate or transform values across filters, projections, and aggregations.
Usage
Each numeric function is defined using the $fn key and takes one or more inputs through the $operands array.
Operands can be scalar values, column references, or any other valid expression.
- All inputs must be numeric types such as
integer,float, ordecimal. - Functions like modulo, bitwise, or factorial require integer inputs.
- When combining different numeric types, explicit casting may be necessary using
$castor$shortCast. - If an operand has an invalid type (e.g. a string), an error is raised.
$abs
Added in: indicate.dsl.dql@1.0.0
Returns the absolute value of a numeric expression.
{
"$fn": "abs",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$unary": {
"$fn": "abs",
"$operand": { "$scalar": -17.4 }
}
}
ABS(-17.4)
$ceil
Added in: indicate.dsl.dql@1.0.0
Rounds a number up to the nearest integer.
{
"$fn": "ceil",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$unary": {
"$fn": "ceil",
"$operand": { "$scalar": 4.3 }
}
}
CEIL(4.3)
$floor
Added in: indicate.dsl.dql@1.0.0
Rounds a number down to the nearest integer.
{
"$fn": "floor",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$unary": {
"$fn": "floor",
"$operand": { "$scalar": 4.8 }
}
}
FLOOR(4.8)
$round
Added in: indicate.dsl.dql@1.0.0
Rounds a number to the nearest integer.
{
"$fn": "round",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$unary": {
"$fn": "round",
"$operand": { "$scalar": 5.6 }
}
}
ROUND(5.6)
$sqrt
Added in: indicate.dsl.dql@1.0.0
Returns the square root of a numeric value.
{
"$fn": "sqrt",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$unary": {
"$fn": "sqrt",
"$operand": { "$scalar": 16 }
}
}
SQRT(16)
$exp
Added in: indicate.dsl.dql@1.0.0
Returns the exponential value of a number (e^x).
{
"$fn": "exp",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$unary": {
"$fn": "exp",
"$operand": { "$scalar": 2 }
}
}
EXP(2)
$pow
Added in: indicate.dsl.dql@1.0.0
Raises a number to the power of another number.
{
"$fn": "pow",
"$operands": [
{ object (Expression) },
{ object (Expression) }
]
}
- JSON
- SQL
{
"$fn": "pow",
"$operands": [
{ "$scalar": 2 },
{ "$scalar": 4 }
]
}
POW(2, 4)
$mod
Added in: indicate.dsl.dql@1.0.0
Computes the remainder of a division operation.
{
"$fn": "mod",
"$operands": [
{ object (Expression) },
{ object (Expression) }
]
}
- JSON
- SQL
{
"$fn": "mod",
"$operands": [
{ "$scalar": 17 },
{ "$scalar": 5 }
]
}
MOD(17, 5)