Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Can formulas return null?

    Posted 12/23/19 09:20 AM
    In Maximo 7.6.1.1,

    I have an attribute formula on a persistent field called WORKORDER.X. The field type is decimal, length is 18, and scale is 10.

    The formula is meant to do this:

    If not null, use WOSERVICEADDRESS.LONGITUDEX
    Else, if not null, use ASSET.X
    Else, if not null, use LOCATION.X

    This is the expression I've come up with:
    NVL(SERVICEADDRESS$LongitudeX, NVL(ASSET$X, NVL(LOCATION$X,0) ) )

    Question:
    If all of the search-values end up being null, is there a way to return null, rather than 0?

    I've tried just typing the word null, but get an error:
    BMXAA9399E - This formula is invalid because the following attribute or token is
    invalid: null. Specify a valid attribute and try again.

    I've also tried "", but that returns 0.
    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Can formulas return null?

    Posted 01/06/20 07:52 AM
    Edited by System Admin 03/22/23 11:44 AM
    Did you try "IF(isnull$WORKORDER.X...." instead of NVL ? You can use a condition as well. If it does not work, sometime it's easier to use an automation skip instead of a formula. Your case is easy to code in a script.

    ------------------------------
    Serge Gagnon
    STI Maintenance
    Jonquiere QC
    ------------------------------



  • 3.  RE: Can formulas return null?

    Posted 01/06/20 01:32 PM
    Edited by System Admin 03/22/23 11:45 AM
    Hi Serge. Good idea. Thanks.

    I tried IF instead of NVL, but unfortunately, I still have the same problem. I can't return null:

    IF(1=1,1,null)

    BMXAA9399E - This formula is invalid because the following attribute or token is invalid: null. Specify a valid attribute and try again.

    And returning the value of a field that is known to be null (as a workaround) produces an error too (IF(1=2,2,X)).
    Also, double-quotes returns zero, not null (not what I'm looking for). 


    ------------------------------
    Thanks
    ------------------------------



  • 4.  RE: Can formulas return null?

    Posted 04/19/20 11:51 PM
    Hi,
    I have the same issue. I also need to return "null" in a similar formula. Does anyone have a solution to this?

    ......................
    Nikolay Stoimenov
    "Dripping water hollows out stone, not through force but through persistence."
    https://nikolay100.com/


    ------------------------------
    Nikolay Stoimenov
    ------------------------------



  • 5.  RE: Can formulas return null?

    Posted 04/20/20 09:50 AM
    Edited by System Admin 03/22/23 11:49 AM


  • 6.  RE: Can formulas return null?

    Posted 09/14/21 09:31 PM
    Edited by System Admin 03/22/23 11:50 AM
    @Nikolay Stoimenov

    From testing, this is what I've found in Maximo 7.6.1.2:

    • Non-persistent fields can handle nulls without issue. I used this to return a null: NULLVALUE( ) 
    • But persistent fields can't seem to handle nulls. I tried using this to return a null: NULLVALUE( )

    Error:

    BMXAA3761E - The event has failed. Ensure that the event is registered correctly. See the log file in the APP HOME directory for more details about the error.

    null

    Word has it that this issue has been fixed in 7.6.1.3 and 8.1.

    Or maybe you're using non-persistent fields, in which case NULLVALUE( ) might help you in your current version.

    Cheers.
    #AssetandFacilitiesManagement
    #Maximo


  • 7.  RE: Can formulas return null?

    Posted 09/15/21 05:51 PM
      |   view attached

    @Nikolay Stoimenov

    Here is a Word doc that shows the testing I did (attached).


    Conclusion:

    Formulas can return null to non-persistent fields.

    But, formulas can't return null to persistent fields.


    I would love to be wrong about this though.