General expressions
Basic building blocks of an expression that can be used in UDCs.
Elements
Expressions follow the basic concepts of unary, binary, and conditional expressions.
Element | Description |
---|---|
Unary | Expression in the form - operator
expression . |
Binary | Expression in the form - expression
operator expression . |
Conditional | Expression in the form - expression ?
expression : expression . |
Constant | Literal Integer, and Float values. |
Function | Expression in the form -
functionName(expr1, ..., exprN) |
Remarks
The following case-insensitive tokens are reserved for use as keywords in
expressions:
AND OR (INT) (FLOAT)
The following characters are used as operators for
punctuation:
! - + * / % ^
Examples
The table below shows some simple examples of expressions that are built up from metrics in a neutral Technology Pack, including unary, binary, conditional operators and functions.
Expression | Description |
---|---|
|
Basic example of unary operator to negate a metric. |
|
Binary expression with constant: Percentage of
tch call seizure successes. |
|
Logic operator example that uses a constant and
Technology Pack formulas (the percentage fields are based on A/B*100 expressions). Where
call_seizure_successes is greater than 3000 select
%_seizure_failures otherwise return %_seizure_successes . |
` |
Use of DECODE function to select an alternative metric where a vendor-specific metric is NULL. If THEN
ELSE
|
Constants
- Applies To
- General Expressions.
- Description
- Constants (often referred to as literals) are values that do not change. There are two types of constants: integer and float.
- Syntax
[[ Integer | Float ]]
- Elements
-
Table 3. Constants - elements Element Description Integer Constant Consists of a sequence of decimal digits. Float Constant Consists of a sequence of decimal digits and exactly one period '.' Examples
Table 4. Constants Integer Constants Float Constants 10 10.2 99999 .234
Conditions
- Applies To
- General Expressions
- Description
- A condition is a logic expression, which returns true or false (1 or 0). Typically, conditions
are not used as expressions in isolation but part of a larger expression. For example, selecting
alternative metrics depending on whether a condition is true or
false:
[Cell]![{Neutral.tch.call_seizure_successes}] > 3000 ? [Cell]![{Neutral.sdcch._%_seizure_failure}] : [Cell]![{Neutral.sdcch._%_seizure_success}]
- Example
- The following table shows the full conditional expression support
available.
Table 5. Conditions - examples Expression Result 10 > 20
0 10 < 20
1
Operators
Operators are used to combine metrics to create new expressions.