-
Notifications
You must be signed in to change notification settings - Fork 6
Math Functions (MathUtils.xml)
This provides some additional math functions.
Unless specified, the functions listed below will be added to the Math category.
Unit tests for all these functions in MathUtils.Test folder.
Syntax: MODULO(Number, Divisor)
Examples:
-
MODULO(1, 2)
returns 1 -
MODULO(2.25, 1.5)
returns 0.75
Version of the MOD function allowing for floating point numbers.
- If either
Modulo
orDivisor
areNULL
, returnsNULL
. - If
Divisor
is 0, then will result in an error.
Added to Spatial
category
C++ Function - HexBinX
Syntax: HEXBINX(PointX, PointY, Radius)
Examples:
-
HEXBINX('A', 'B')
returnsA
-
COALESCE(NULL, 'B')
returnsB
-
COALESCE(NULL, NULL< 'C')
returnsC
Given a point X, Y, returns the center of hexagonal bin containing the point. An optional third parameter, allows the size of the Hexagon to be changed (defaults to 1). Reproduces Tableau HEXBINX function, based on the d3.js implementation.
- All parameters must be same general type (numeric vs text (including dates/datetimes as text)).
- Minimum of 2 parameters, but can be as many as you need.
- If all parameters are null, returns
NULL
.
Added to Spatial
category
C++ Function - HexBinY
C++ Function - Average
Syntax: AVG(Value1, Value2, ...)
Takes variable number of parameters.
- All parameters must be numeric type.
- Minimum of 2 parameters, but can be as many as you need.
- If all parameters are null, returns
NULL
.
C++ Function - Count
Syntax: COUNT(Value1, Value2, ...)
Takes variable number of parameters.
- Minimum of 2 parameters, but can be as many as you need.
- If all parameters are null, returns 0.
C++ Function - Sum
Syntax: SUM(Value1, Value2, ...)
Takes variable number of parameters.
- All parameters must be numeric type
- Minimum of 2 parameters, but can be as many as you need.
- If all parameters are null, returns 0.