Skip to main content
12-Amethyst
January 6, 2026
Solved

Calculated Attribute give no results

  • January 6, 2026
  • 2 replies
  • 122 views
I am using Windchill PDMLink Release 12.0 and Datecode with CPS 12.0.2.13

Hello,
On WTParts I have the parts weight either mapped from associated EPMDocument in an attribute named PRO_MP_MASS or manually typed into an attribute named AttrB. Both are of type Real Number with Units.
I want to make a calculated attribute that have this expected outcome:
- If PRO_MP_MASS has a value higher than 0.1 kg, the value of PRO_MP_MASS should be the result
- If PRO_MP_MASS has no value or is below 0.1 kg, the value of AttrB should be the result
- If both PRO_MP_MASS is below 0.1 or has no value and AttrB has no value, the result should be "No weight assigned".

Used formula: ((!isNull(PRO_MP_MASS) || (PRO_MP_MASS > 0.1)) ? PRO_MP_MASS : ((!isNull(AttrB)) ? AttrB : "No weight assigned"))

What ever combination of values and empty values I make, I get no results in the calculated attribute.
What am I missing?


Here are the errors that I faced
None
    Best answer by MartinBach

    My mistake was that I created the calculated attribute as a Real Number with Unit type attribute, should have been a String type.
    So with that and a suggested formula from cgautier including the unit() function it works:
    ((!isNull(PRO_MP_MASS) && (PRO_MP_MASS > unit("0.1 kg"))) ? str(PRO_MP_MASS) : ((!isNull(ManWeightSpec)) ? str(ManWeightSpec) : "No weight assigned"))

    Thank you
    /Martin

    2 replies

    18-Opal
    January 7, 2026

    Hello MartinBach,

    Did you review kb article https://www.ptc.com/en/support/article/CS317541 ?

    KR,

    Charles.

    12-Amethyst
    January 8, 2026

    Hello cgautier,
    Thank you for your reply.
    I had not seen the kb article, but it does not seem to help much.
    I simplified the formula to: ((!isNull(PRO_MP_MASS)) ? PRO_MP_MASS : ((!isNull(AttrB)) ? AttrB : "No weight assigned")), but only get a result in the calculated attribute if both PRO_MP_MASS and AttrB are empty.
    /Martin

    MartinBach12-AmethystAuthorAnswer
    12-Amethyst
    January 13, 2026

    My mistake was that I created the calculated attribute as a Real Number with Unit type attribute, should have been a String type.
    So with that and a suggested formula from cgautier including the unit() function it works:
    ((!isNull(PRO_MP_MASS) && (PRO_MP_MASS > unit("0.1 kg"))) ? str(PRO_MP_MASS) : ((!isNull(ManWeightSpec)) ? str(ManWeightSpec) : "No weight assigned"))

    Thank you
    /Martin