Friday 12 October 2018

Database configuration formula | Maximo

Formulas are introduced from Maximo 7606 on ward, which leveraged us to make calculation related things easier as we were already doing it through auto scripts.

Although it is not new after 761 release but still not very common.

There are 2 types of DB formulas; attribute formulas and Object level formulas.

Below mentioned is one example of Attribute formula in database configuration.

In this example we write a simple Excel style IF condition formula.




In db configuration, select action , add/modify formula for attribute, new row
Object: PR
Attribute: priority
Formula expression:
IF(status=="WAPPR",5,count$prline)

( Print 5 in priority if status ia WAPPR , ELSE anything else, I wrote another function to count all PR lines. A new syntax is introduced as functionname$relationshipname$attributename
Thanks
Therefore i used above mentioned to count prline of current mbo.

Note: dollar $ sign is used as seperator instead of dot (.)
Because in numbers dot (.) is a decimal place.


Hit Save to calculate/run this formula. We can say it runs before save, before update like behaviour of auto script.


------------------
Example:
Add 48 hours into Change Date in Asset:
1. create an new Decimal Attribute lets say, zzExpiryDate (Decimal 16,2)
2. Write an attribute formula (select Action > Add/modify Attribute Formula
object : Asset
Attribute: zzExpiryDate 
Formula: changedate + DURATION(0,0,0,48,0,0) 
in 6 parameters ­ DURATION year,month,day,hour,min,sec)
--------------------
Example:
Add 48 hours as target, and tell me the remaining Hours I have:
1. create an new Decimal Attribute lets say, zzRemaining (DURATION)
2. Write an attribute formula (select Action > Add/modify Attribute Formula
object : Asset
Attribute: zzRemaining
Formula: (DATETIMETEST+DURATION(0,0,0,48,0 ,0)-$sysdate$)/3600000

3 comments:

  1. I'm curious if you have an example of an object formula ?

    ReplyDelete
  2. I'm also curious if you have an example of an object formula.

    ReplyDelete