Referentie: operatoren en functies voor berekeningen
Syntaxisregels
- Rekeningen, berekeningen en aangepaste metriekwaarden. Vereist. Gebruik de rekeningcode (niet de naam) of gebruik de code van de berekening in expressies.
- Moet tussen vierkante haakjes staan. Evoorbeeld:[1000_Assets]of[My_Quick_Ratio].
- Versies. Optioneel. Gebruik deze syntaxis:[code](version = [version name])om te verwijzen naar een versie van een rekening, berekening of aangepaste metriek die in uw instance is gedefinieerd. Bijvoorbeeld:[headcount_FTE](version = [Forecast 2018]), waarbijHeadcount_FTEde rekening is enPrognose 2018de versie. Als er niets is opgegeven, wordt de standaardversie gebruikt. Zie Concept: berekeningen in diagrammen voor meer informatie overversies en volgorde van prioriteit.
- Moet tussen haakjes staan.
- Haakjes zijn vereist wanneer de versienaam spaties bevat.Werk budgetmoet bijvoorbeeld tussen haakjes staan. VoorWerkbudgetzijn geen haakjes vereist.
- Operatorprioriteit: evalueert van links naar rechts of sluit ind tussen haakjes om als eerste te berekenen.
Wiskundige operatoren
Operator | Description | Syntax |
|---|---|---|
+ | Adds two values. | [metric1] +
[metric2] |
- | Subtracts two values. | [metric1] -
[metric2] |
/ | Divides two values. | [metric1] /
[metric2] |
* | Multiplies two values. | [metric1] *
[metric2] |
% | Calculates the remainder (modulus) when dividing two
values. | [metric1] %
[metric2] |
^ | Raises the value on the left to the power of the value on the
right. For example, 5^ 2 = 25. | [metric1]
^2 |
Vergelijkingsoperatoren
Gebruik vergelijkingsoperatoren met de iif-functie. Evoorbeeld:
iif([30_Net_Income] <= ([41_laptopRev] + [42_desktopRev] + [43_tabletRev]), [30_Net_Income], 40_Product_Revenue])
.Operator | Description | Syntax |
|---|---|---|
= | Checks if two values are equal. | [metric1] =
[metric2] |
<> | Checks if two values are not equal. | [metric1] <>
[metric2] |
< | Checks if the left value is less than the right value. | [metric1] <
[metric2] |
<= | Checks if the left value is less than or equal to the right
value. | [metric1] <=
[metric2] |
> | Checks if the left value is greater than the right value. | [metric1] >
[metric2] |
>= | Checks if the left value is greater than or equal to the right
value. | [metric1] >=
[metric2] |
BETWEEN | Checks if a value is between two other values. Minimum and
maximum values are included in the range. Use with the
AND operator. | [metric1] BETWEEN 0
AND [metric2] |
NOT BETWEEN | Checks if a value is not between the two other values. Minimum
and maximum values are included in the range. Use with the
AND operator. | [metric1] NOT BETWEEN
0 AND [metric2] |
AND | Compares two expressions and returns true if both expressions are
true. | ([metric1] >=
[metric2]) AND ([metric1] >= [metric3]) |
OR | Compares two expressions and returns true if either expression is
true. | ([metric1] >=
[metric2]) OR ([metric1] >= [metric3]) |
Vergelijkingsfunctie
Functie | Omschrijving | Voorbeeld |
|---|---|---|
iif( vergelijking , expressie waar , expressie onwaar ) | Hiermee wordt de expressie van de vergelijking geëvalueerd. Als deze waar is, wordt de expressie waar geretourneerd. Anders wordt de expressie
onwaar geretourneerd. | iif([metric1] > 10 AND [metric1] < 20, [metric2], [metric3])
|
Berekeningsfuncties
Function | Description | Example |
|---|---|---|
min( expression ,
expression ) | Returns the smallest value of two expressions. | min([metric1],
[metric2]) |
max( expression ,
expression ) | Returns the largest value of two expressions. | max([metric1],
[metric2]) |
sin( expression ) | Returns the sine of a metric or expression. Used in
Trigonometry. | sin([metric1]) |
cos( expression ) | Returns the cosine of a metric or expression. Used in
Trigonometry. | cos([metric1]) |
tan( expression ) | Returns the tangent of a metric or expression. Used in
Trigonometry. | tan([metric1]) |
abs( expression ) | Returns the absolute value of a metric or expression. Use to
convert negative numbers to positive numbers. | abs([metric1]) |
sqrt( expression ) | Returns the square root of a metric or expression. | sqrt([metric1]) |
round( expression ) | Rounds a numeric value to the nearest whole number. The
mid-point is rounded up. Examples:
| round([metric1]) |
round( expression ,
digits ) | Rounds a numeric value to a specified number of digits.
Positive digits round to the specified number
of decimal places. Negative digits round to
the nearest multiple of 10. Examples:
| round([metric1],
1) |
floor( expression ) | Returns a numeric value rounded down towards zero.
Examples:
| floor([metric1],
2) |
floor( expression ,
expression ) | Returns a numeric value rounded down towards zero, to the
nearest multiple of significance. Examples:
| floor([metric1],
2) |
ceiling( expression ) | Returns number rounded up away from zero. Examples:
| ceiling([metric1]) |
ceiling( expression ,
expression ) | Returns number rounded up, away from zero, to the nearest
multiple of significance. Examples:
| ceiling([metric1],
2) |
Validatiefuncties
Functie | Omschrijving | Voorbeeld |
|---|---|---|
isnull( expressie , NULL-expressie ) | Hiermee wordt gecontroleerd of de expressie NULL is. Als dit waar is, wordt de NULL-expressie geretourneerd. Anders retourneert de expressie
waarde. | isnull([metric1], [metric2])
|
isinfinity( expressie , oneindigheidsexpressie ) | Hiermee wordt gecontroleerd of de expressie oneindig is (delend door nul). Als dit waar is, wordt de oneindigheidsexpressie geretourneerdwaarde. Anders wordt de waarde van de expressie geretourneerd. | isinfinity([metric1], [metric2])
|
isnan( expressie , NaN-expressie ) | Hiermee wordt gecontroleerd of de expressie geen getal is (nul gedeeld door nul). Als dit waar is, wordt de NaN-expressie geretourneerdwaarde. Anders retourneert de expressie
waarde.
| isnan([metric1], [metric2])
|
isrn( expressie , NrN expressie ) | Hiermee wordt gecontroleerd of de expressie een reëel getal is, zoals oneindig, nan of nul. Als dit waar is, wordt . geretourneerdthe NrN-expressie
waarde. Anders retourneert de expressie
waarde. | isnan([metric1], [metric2])
|