Skip to main content
Solved

FME wont subtract numerical values with arithmetric expression.

  • April 28, 2021
  • 1 reply
  • 395 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

View original
Did this help you find an answer to your question?

1 reply

nielsgerrits
VIP
Forum|alt.badge.img+54
  • 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


Reply


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