TransWikia.com

QGIS 3.10 - Field calculator expression running in Attribute Table and not in Processing Modeler

Geographic Information Systems Asked on November 26, 2021

I use the Field Calculator in the Attributes table and run the operation : "FieldA" - "FieldB", where "FieldA" and "FieldB" are height distances in meter with a double type (i.e. 2,45). The operation run smoothly.

Now, when I do the same operation using the Field Calculator within the Processing Modeler, it does not run the operation without failure. The message error on the Output Preview in the Expression Editor is reporting Cannot convert "FieldA" to double. So it seems that the coding of the expression is not equivalent in both Field Calculator.

In the Field Calculator within the Processing Modeler, I tried :

  • "FieldA" - "FieldB"
  • manual input:fields then @FieldA - @FieldB
  • to_real("FieldA") - to_real("FieldB")
  • to_real(replace(to_string("FieldA"), ',', '.')) - to_real(replace(to_string("FieldB"), ',', '.'))

I am surely missing something fundamental in how this is running. Would anyone have encountered the same issue?

Many thanks!

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP