Skip to main content
Question

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

  • April 5, 2018
  • 1 reply
  • 73 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 Message: 
2018-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.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • 7843 replies
  • 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.