Question

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

  • 6 April 2018
  • 1 reply
  • 12 views

Badge +1

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.

1 reply

Userlevel 2
Badge +17

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.

Reply