Solved

FME wont subtract numerical values with arithmetric expression.

  • 28 April 2021
  • 1 reply
  • 96 views

Badge

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?

icon

Best answer by nielsgerrits 28 April 2021, 10:15

View original

1 reply

Userlevel 6
Badge +33

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

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

2021-04-28_10h16_39

Reply