I want to make a model with a vector layer to calculate the sum of two parameters contained in the attribute table of the layer.
I want to create two variables in the model, the name of the two fields of the attribute table to use in the model for the calculation of the new field (A and B), but the geoprocess of the advanced field calculator with python does not get to configure so that you can relate those two variables.
Best Answer
Use the normal Field Calculator and in the Formula option, select
Pre-calculated Value
. Then use the expression:where the parameters
@a
and@b
are the fields you assign when running the model. This is read by the field calculator as a string version of: