Skip to main content
Question

Arithmetic Editor - Math Operator (x?y:z) - Failed to evaluate expression

  • April 5, 2018
  • 1 reply
  • 54 views

Forum|alt.badge.img+3

Why doesn't this work?

@Value(SP)=FD?@Value(PCT):0

 

If the value of attribute SP is FD, then use the value of attribute PCT, otherwise 0. I tried using 'FD' and "FD" too.

 

 

2018-04-05 22:58:55|   8.1|  0.0|WARN  |AttributeManager_19: TCL Error Message2018-04-05 22:58:55|   8.1|  0.0|WARN  |     invalid bareword "FD"
2018-04-05 22:58:55|   8.1|  0.0|WARN  |     in expression "FD=FD?10.0:0";
2018-04-05 22:58:55|   8.1|  0.0|WARN  |     should be "$FD" or "{FD}" or "FD(...)" or ...
2018-04-05 22:58:55|   8.1|  0.0|WARN  |AttributeManager_19: Failed to evaluate expression 'FD=FD?10.0:0'.  Result is set to null.

1 reply

takashi
Contributor
Forum|alt.badge.img+22
  • Contributor
  • April 5, 2018

Hi @mikek, in math expressions, you can operate only numeric values.

If you need to create a new attribute which could have one of two different values (@Value(PCD) or 0 in this case) depending on a condition whether an attribute value (@Value(SP)) is equal to a literal string 'FD', consider using conditional value setting in an AttributeCreator or an AttributeManager.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings