CDL Functions
You can include a function in an expression.
- The function does an operation on its arguments.
- The function returns a value that you can use to evaluate the entire statement.
- You can use the value that the function returns in other parts of the expression.
- You can use the result as an operand of another operator or function. The result’s data type must match the data type that you use in the other operator's or function's argument.
Note
- A function includes one or more arguments.
- You must enclose the function's arguments in parentheses.
- If your expression has more than one function, then you must use a comma to separate each function.
- An argument can be an expression.
This example includes operations for the Round function. Feature-x and Feature-y must be numeric features:
Round (13.4)
Round (Feature-x / Feature-y)
You can use these types of functions.
- Arithmetic
- Trigonometric
- Logical
- Set
- Text
- Hierarchy or Compound
Arithmetic Functions
Function | Description |
---|---|
Abs(x) |
|
AggregateSum(x) |
|
Ceiling(x) |
|
Exp(x) |
|
Floor(x) |
|
Log(x) |
|
Log10(x) |
|
Max(x,y,z...) |
|
Min(x,y,z...) |
|
Mod(x,y) |
|
Pow(x,y) |
|
Round(x) |
|
RoundDownToNearest(x,y) |
|
RoundToNearest(x,y) |
|
RoundUpToNearest(x,y) |
|
Sqrt(x) |
|
Truncate(x) |
|
The term infinity means its value has no limit. It can be infinite in the positive direction or in the negative direction.
- -infinity means that the value can be any value that's zero or smaller than zero.
- +infinity means that the value can be any value that's zero or greater than zero.
Trigonometric Functions
Function | Description |
---|---|
Sin(x) |
|
ASin(x) |
|
Sinh(x) |
|
Cos(x) |
|
ACos(x) |
|
Cosh(x) |
|
Tan(x) |
|
ATan(x) |
|
Tanh(x) |
|
Logical Functions
Function | Description |
---|---|
AllTrue |
|
AnyTrue |
|
Not |
|
Text Functions
Each of these text functions compares two operands of text literals.
Function | Description |
---|---|
BeginsWith | If the first character of the first operand matches the first character
of the second operand, then it returns true . |
Contains | If the value in the first operand contains the value in the second
operand, then it returns true . |
EndsWith | If the last character of the first operand matches the last character of
the second operand, then it returns true . |
Equals | If the value in the first operand equals the value in the second
operand, then it returns true . |
Matches | If the value in the first operand matches the value in the second
operand, then it returns true . |
NotEquals | If the value in the first operand doesn't equal the value in the second
operand, then it returns true . |
Note
- Don't use a text function in the body of a constraint or statement that accumulates a value unless it evaluates to a constant string. Configurator will validate this condition.
- You can use a text function can with static text. For example, in the WHERE clause of an iterator.
Option Function
Function | Description |
---|---|
OptionsOf | Takes the name of an option class or a feature as an argument and returns its options. |