Maximo formula operators and functions
Maximo® formulas support most common mathematical operators and functions. The formulas combine the formula expression syntax with Maximo business objects and Maximo business object (MBO) attributes.
Supported operators
The following table lists supported operators for Maximo formulas.
Mathematical operator | Description | Examples of usage |
---|---|---|
+ | Addition | purchaseprice + tax |
− | Subtraction | enddate − startdate |
* | Multiplication | unitcost * quantity |
⁄ | Division | totalcost⁄quantity |
% | Remainder | a%b |
^ | Power® | a^2 |
Logical operator | Description | Examples of usage |
---|---|---|
&& | Logical And | if(a>10 && b<20, x,y) |
|| | Logical Or | if(a>10 || b<20, x,y) |
>, ≥ | Greater than, greater than equals | if(a≥10 || b>20, x,y) |
<,≤ | Less than, less than equals | if(a<10 || b≤20, x,y) |
=, == | Equals comparison | if(a=10 || b==c, x,y) |
!=, <> | Not equals | if(a<>10 && b!=c, x,y) |
Supported functions
The following tables list supported functions for Maximo
formulas.
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
meteravgval | 2 | Calculates the average meter value over a time span. This function is applicable only to gauge meters. | meteravgval("O_pressur", duration(0,0,30,0,0,0)) , which gives you the
average reading of the 0_pressur meter over a span of the last 30 days. |
meterexceedcount | 3 | Calculates the number of times the meter readings exceeded the target value. | meterexceedcount("O_pressur", duration(1,0,0,0,0,0),0.9) which counts the
meter readings that are above 0.9 in the last one year. |
meterlowaction | 1 | Obtains the meter lower action value from the measurement point. It is commonly used in the Condition Monitoring application. | meterlowaction("metername") |
meterlowwarning | 1 | Obtains the meter lower warning value from the measurement point. It is commonly used in the Condition Monitoring application. | meterlowwarning("metername") |
metermaxval | 2 | Calculates the maximum meter value over a time span. It is only applicable to numeric meters. | metermaxval("O_pressur", duration(1,0,0,0,0,0)) which gives you the maximum
reading of the 0_pressur meter over the last one year. |
meterminval | 2 | Calculates the minimum meter value over a time span. It is only applicable to numeric meters. | meterminval("O_pressur",duration(1,0,0,0,0,0) which gives you the minimum
reading of the 0_pressur meter over the last one year. |
meterupaction | 1 | Obtains the meter upper action value from the measurement point. It is commonly used in the Condition Monitoring application. | meterupaction("metername") |
meterupwarning | 1 | Obtains the meter upper warning value from the measurement point. It is commonly used in the Condition Monitoring application. | meterupwarning("metername") |
meterval | 1 | Calculates the last reading for a meter associated with an asset or location. It can be used to read any type of meter, characteristic, or gauge or continuous. | if(meterval("oilcolor")=="clear", 1,0) in which
meterval("oilcolor") returns a string value as oilcolor. |
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
addymd | 4 | Adds year as the second parameter, month as the third parameter, and day as the fourth parameter to the first parameter, which is a date and time field. | addymd(statusdate,1,5,6) . The formula adds 1 year, 5 months, and 6 days to
the statusdate field. |
date | 3 | Specifies a date with year, month, and day in a formula | date(2024,11,30) is used to specify 30 November 2024 as the date. |
datetime | 6 | Specifies a date with year, month, and day and a time with hours, minutes, and seconds in a formula. The hour follows the 24-hour format. | datetime(2024,11,30,6,45,0) is used to specify 30th of November, 6:45 AM as
the date and time. |
duration | 6 | Specifies a duration with years, months, days, hours, minutes, and seconds in a formula. | duration(0,0,0,2,0,0) is used to specify a duration of two hours. |
msince | 1 | Calculates the number of months from a date and time field that is specified as a parameter in the function. | msince(statusdate) returns a value of 6 if the status date is six months
old. |
now | 0 | Obtains the current date and time. | now() |
subymd | 4 | Subtracts year as the second parameter, month as the third parameter, and day as the fourth parameter from the first parameter, which is a date and time field. | subymd(statusdate,1,5,6) . The formula subtracts 1 year, 5 month, and 6 days
from the statusdate field. |
time | 3 | Specifies the time in hours, minutes, and seconds. | time(6,45,0) |
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
abs | 1 | Obtains the absolute value of a number | abs(a) |
avgf | 4 | Calculates the average value of a related attribute over a period. | avgf("openwo","wopriority","statusdate",duration(10,0,0,0,0,0)) |
ceiling | 1 | Rounds a value up to the nearest integer. | ceiling(3.2) returns 4. |
countf | 3 | Calculates the count of a related set of attributes over a time period. | countf("openwo","statusdate",duration(0,0,10,0,0,0)) |
floor | 1 | Rounds a value down to the nearest integer. | FLOOR(3.2) returns 3. |
maxf | 4 | Calculates the maximum value of a related attribute over a time period. | maxf("relation","attr_to_sum", "timeline_attr", duration(0,0,10,0,0,0)) The
timeline_attr is of type Date or Date Time. |
minf | 4 | Calculates the minimum value of a related attribute over a time period. | minf("relation", "attr_to_sum", "timeline_attr", DURATION(1,0,0,0,0,0)) The
timeline_attr is of type Date or Date Time. |
number | 1 | Converts an alphanumeric value to a numeric value. | number("lastreading") |
nvl | 2 | Returns the alternative value if the original value is null. | nvl(a,b) returns b if a is null. |
pct | 2 | Returns the percentage of the first parameter based on the second parameter. | pct(val,total) |
round | 2 | Rounds a number based on a precision or scale. | round(linecost,2) |
sqrt, sin, log, log10, tan, cos, asin, acos, atan, sinh, cosh, tanh, rad, deg |
1 | Basic mathematical functions | sqrt(4) returns 2. |
sumf | 4 | Calculates the sum of a related attribute over a time period. | sumf("openwo","estmatcost","statusdate", duration (0,0,10,0,0,0)) The
formula is based on the Asset object to sum up the estmatcost for all open work
orders, that is, openwo relationship, for the last 10 days relative to the status
date. |
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
ismodified | 1 | Checks if an attribute is modified. Returns a value of 0 or 1. | ismodified("status") |
isnullf | 1 | Checks if the value is null. Returns a value of 0 or 1. | isnullf(priority) |
isreadonly | 1 | Checks if an attribute is marked as read-only. Returns a value of 0 or 1. | isreadonly("status") |
isrequired | 1 | Checks if an attribute is set as required. Returns a value of 0 or 1. | isrequired("status") |
maxcond | 1 | Evaulates the condname system condition and return TRUE or FALSE. | maxcond(condname) |
specattrval | 1 | Returns the specification attribute value. | if(specattrval("life")>10,10,0) |
tobeadded | 0 | Returns TRUE if the launchpoint MBO is marked for creation and FALSE if it is not. | tobeadded() |
tobedeleted | 0 | Returns TRUE if the launchpoint MBO is marked for deletion and FALSE if it is not. | tobedeleted() |
tobesaved | 0 | Returns TRUE if the launchpoint MBO is marked for saving and FALSE if it is not. | tobesaved() |
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
if | 2 | Returns the valueiftruevalue if the condition condition evaluates to TRUE. You can specify a value that is returned when the condition condition evaluates to FALSE by populating the valueiffalse parameter. | if(condition, valueiftrue[, valueiffalse]) |
error | 2 | Creates an MXException error by using the errgrp and errkey parameters. | error("MyGroup","premium_hours") |
nullvalue | 0 | Returns a null value | nullvalue() |