List of formula data reference operators
- Last UpdatedJan 07, 2025
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
You can use the following operators in formula data references (in order of precedence):
|
Operator |
Precedence |
|---|---|
|
Parenthesis |
9 (calculated first) |
|
Unary Minus |
8 |
|
^ |
7 |
|
* / mod |
6 |
|
+ - |
5 |
|
< > <= >= == <> |
4 |
|
NOT |
3 |
|
AND |
2 |
|
OR |
1 (calculated last) |
You cannot use the assignment operator = at the beginning of any formula.
Note: Formula data reference syntax uses == (two equals signs) to indicate equality and = (single equals sign) for assignment. Analytics (and performance equation) syntax uses = to indicate equality and := for assignment.
Compound operators
You can choose If-Then-Else, a compound operator with operands used as follows:
If expr0 Then expr1 Else expr2
where expr0, expr1, and expr2 are expressions. If expr0 is true, the value of expr1 is returned; otherwise, the value of expr2 is returned.
Formula example
This sample formula calculates the daily average cost of reagent per tonne processed, as shown in the Value field for Grinding Media in the following mineral processing illustration:
A=.|Addition (Daily Total);B=.|Unit Cost;C=Tonnage (Past 24 Hours);[if C ==0 then digstate("No Data") else A*B/C]
Sample formula data reference
