The base language used for the formulas is a subset of SQL Server Transact SQL.
There are two macro-categories of KPIs:
- KPI on live calculation
- KPI on periodic calculation
The distinction between live calculation and periodic calculation is defined by the @@CALCULATE_EVERY directive.
It is not possible to write a script-style procedure, with supporting variables or anything else; the formula is designed to be the result of a direct calculation.
We cannot therefore write a formula like:
DECLARE @multiplier INT = 10;
DECLARE @offset FLOAT = 2.5;
SELECT @temperature * @multiplier + @offset;
But you will have to write the formula like this:
@temperature * 10 + 2.5;
In addition to the Transact SQL code, specific directives and functions are available for the Rilheva Platform.
Furthermore, it is possible to add comments within the formula to better explain the various steps:
- “–”: to add a single line comment; it could be added at the end of a single instruction as well.
Examples:
// the following instruction sums two temperatures
@temp1 + @temp2;
@temp1 + @temp2; — Sum of temperatures
- “/* */”: to add a multi-line comment:
Example:/*
Written by John Doe, 2022-02-15.
Sum of temperatures.
*/
@temp1 + @temp2;
Was this helpful?
0 / 0