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 | unit cost * 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
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 O_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 O_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 O_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)) |
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)) |
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. |
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
ISMODIFIED | 1 | Checks if an attribute is modified | ISMODIFIED('STATUS') |
ISNULLF | 1 | Checks if the value is null | ISNULLF(priority) |
ISREADONLY | 1 | Checks if an attribute is marked as read-only. | |
ISREQUIRED | 1 | Checks if an attribute is set as required. | |
MAXCOND | 1 | Evaulates the condname system condition and return TRUE or FALSE. | MAXCOND(condname) |
SETWHERE | 2 | Sets a where clause to an MBOSet by using a condition. | SETWHERE(varname,condname) |
SPECATTRVAL | 1 | Sets the specification attribute value. | SPECATTRVAL("LIFE") |
TOBEADDED | 1 | Returns TRUE if the launchpoint MBO is marked for creation and FALSE if it is not. | TOBEADDED(mboname) |
TOBEDELETED | 1 | Returns TRUE if the launchpoint MBO is marked for deletion and FALSE if it is not. | TOBEDELETED(mboname) |
TOBESAVED | 1 | Returns TRUE if the launchpoint MBO is marked for saving and FALSE if it is not. | TOBESAVED(mboname) |
WARNING | 2 | Sets warning to MBOSet |
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 | Not applicable |
THROW | 1 | Displays an MXException and is an MBR construct. It must not be used for mathematical use cases. | Not applicable. |
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
ISYNCCANCEL | 1 | Checks if the user input is a cancel action. | |
ISYNCFLT | 1 | Checks if the user input is a null value. | |
ISYNCNO | 1 | Checks if the user input is a no. | |
ISYNCOK | 1 | Checks if the user input is an OK. | |
ISYNCYES | 1 | Checks if the user input is a yes. |
The weather functions use the relationship between Asset and Location and the Service Address objects. The Asset object uses the SERVICEADDRESSLOGIC relationship, while the Locations object uses the SERVICEADDRESSHIERARCHY relationship to connect to the Service Address object. The weather interface expects a geographical location and the weather functions return NULL if the Service Address object does not have the latitude and longitude set.
Purchase the IBM weather API keys before you use the weather functions.
Function name | Number of parameters | Description | Examples of usage |
---|---|---|---|
WCVAL | 1 | Uses the current weather API to get the current value of a weather element. The federated resource that it connects to is CURWEATHER. | WCVAL("temp") gives you the current value for temp . |
WHAVG | 2 | Calculates the average of any weather element over a span of days. It uses two parameters, the weather element name and the number of days. | IF(WHAVG("temp",10)>80,0,1) In the formula,
WHAVG("temp",10) gives you the average temperature value for last 10 days. |
WHMAX | 2 | Calculates the maximum value for any weather element over a span of days. It uses two parameters, the weather element name and the number of days. | IF (WHMAX("temp",10)>100 && WHAVG("temp",10)>80,0,1) In the
formula WHMAX("temp",10) gives you the maximum temperature for last 10
days. |
WHMIN | 2 | Calculates the minimum value for any weather element for a span of days. It uses two parameters, the weather element name and the number of days. | IF (WHMIN("temp",10)>0 && WHAVG("temp",3)<32,0,1 |
WHTCOUNT | 4 | Used the historical weather API to get the count of days in which a weather element exceeds or afalls beyond specified value. | IF(WHTCOUNT("temp", 10, 100,1)>=9,0,IF(WHTCOUNT("temp", 10, 100,1)>3
&&WHTCOUNT("temp",10, 100, 1)<9,0.5,1)) In the formula, WHTCOUNT("temp",
10,100,1) gives you the count of times, temp exceeded the value 100 in the
last 10 days. |