Skip to main content
Solved

FME wont subtract numerical values with arithmetric expression.

  • April 28, 2021
  • 1 reply
  • 573 views

so_much_more
Supporter
Forum|alt.badge.img+6

I simply want to calculate the difference between two numerical values. (In this case elevation taken as an attribute)

I want to add a new attribute with this information and thus sing the AttributeManager.

 

My expression is as follow

@Value(_elevation)-@Value(cover_z)

But it come out as 1.87-3.14 in the new attribute. How do I make it actually subtract?

I found that _elevation had comma as delimeter whilst cover_z had period as delimiter. 

I have tried to find out what datatype FME is interpreting the fields but there are no way of finding if FME see it as string or float?

I did however try to wrap each attriubute in @int8(<float>) to cast it to numeric, that did not work.

I used string replaces and got the to use the same delimiter, but that did not work either?

I just want to do a simple subtraction between values... any advice?

Best answer by nielsgerrits

You need to put it in @Evaluate() to do arithmetric.

@Evaluate(@Value(_elevation)-@Value(cover_z))

2021-04-28_10h16_39

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

nielsgerrits
VIP
Forum|alt.badge.img+62
  • Best Answer
  • April 28, 2021

You need to put it in @Evaluate() to do arithmetric.

@Evaluate(@Value(_elevation)-@Value(cover_z))

2021-04-28_10h16_39