I am using QGIS 3.22 and I am making some algorithm in Modeler enter image description here
I am using Vector Layer as layer and Vector Field as field (it is field with real values and nulls). I want to add column with sum of field. So in Field calculator I use following formula
As a result I get NULL field instead of my input field and the following error message is shown:
Eval Error: Cannot use aggregate function in this context.
How to use aggregate functions correctly?
-
Please provide relevant error messages.Erik– Erik2023年02月27日 15:51:23 +00:00Commented Feb 27, 2023 at 15:51
-
@Erik Eval Error: Cannot use aggregate function in this contextPrintScreenSys– PrintScreenSys2023年02月27日 17:30:41 +00:00Commented Feb 27, 2023 at 17:30
1 Answer 1
This is a bit tricky in QGIS - may be it is an error because it is not logical, which QGIS mostly is - but anyway, you have to change your formula to precalculated value
and then make a string representation of your formula like:
'sum(' || @field || ')'