The application allows formulas to be defined, in virtual meters, widgets or alerts. These are used to specify calculations that will be made dynamically from stored data from physical meters
Among the functions available, some can perform arithmetic or trigonometry calculations.
Arithmetic
Arithmetic operators
The formula language provides the following arithmetic operators:
| Operator | Role | Example |
+ |
Addition | counter1 + counter2 |
- |
Subtraction | counter1 - counter2 |
* |
Multiplication | counter1 * counter2 |
/ |
Division In case of division by 0, a missing data will be returned (null) |
counter1 / counter2 |
Note that it is possible to use constant values (e.g. 200, 15.6, etc.) and parentheses to group operations.
Example
(counter1 + counter2) / 1000
MAX(expression1, expression2, ..., expression n)
Calculates the maximum value between several expressions.
Exemple
MAX(counter1, counter2)
Returns the value of counter1 if counter1 > counter2 otherwise returns the value of counter2
MIN(expression1, expression2, ..., expression n)
Calculates the minimum value between several expressions.
Exemple
MIN(counter1, counter2)
Returns the value of counter1 if counter1 < counter2 otherwise returns the value of counter1.
POWER(expression, integer n)
Returns the power n of the expression.
Exemple
POWER(counter1, 2)
Returns counter1 to power 2.
SUM(expression1, expression2, ..., expression n)
Calculates the sum of several expressions.
Note that, unlike the + operator (depending on platform configuration), the SUM function ignores missing values: the function will return the sum of known values. Whereas with the + operator, if one of the operands is missing (null), then the result will also be null.
AVG(expression1, expression2, ..., expression n)
Calculates the average of several expressions.
Missing values (null) will be ignored in the calculation.
EXP(expression)
Returns the exponential of the expression
Exemple
EXP(expr1)
Returns the exponential of the expr1
LN(expression)
Returns the natural logarithm of the expression
Exemple
LN(expr1)
Returns the natural logarithm of the expr1
LOG(expression, base n)
Returns the logarithm of the expression in base n
Exemple
LOG(expr1, 2)
Returns the logarithm of the expr1 in base 2
Trigonometry
SQRT(expression)
Returns the square root of the expression.
ABS(expression)
Returns the absolute value of the expression.
COSD(angle)
Returns the cosine of an angle (expressed in degrees).
SIND(angle)
Returns the sine of an angle (expressed in degrees).
TAND(angle)
Returns the tangent of an angle (expressed in degrees).
COTD(angle)
Returns the cotangent of an angle (expressed in degrees).
DEGREES(angle)
Converts an angle (expressed in radians), to degrees.
Arrondi
CEIL(expression)
Returns the smallest integer greater than or equal to the expression
Exemple
CEIL(counter1)
Returns the smallest integer greater than or equal to the meter
FLOOR(expression)
Returns the smallest integer less than or equal to the expression
Exemple
FLOOR(counter1)
Returns the smallest integer less than or equal to the meter
ROUND(expression, integer n)
Returns the value of a number rounded to the nearest n decimal places of the expression
Exemple
ROUND(counter1, 2)
Returns the value of a number rounded to the nearest second decimal place of the meter
Commentaires
0 commentaire
Vous devez vous connecter pour laisser un commentaire.