I'm looking to create five fields of grouped means within 33 shapefiles. I'm using the Graphical Modeler to save me using the Field Calculator 5 x 33 times.
The new fields are the means of the traffic volumes ("AADT") of five modes, grouped by road types ("DESC_TERM") in the shapefiles. These functions work when calculating 'manually':
mean( "AADTallc_1" , "DESC_TERM" , "AADTallc_1" != 0.0)
mean( "AADTalllgv" , "DESC_TERM" , "AADTalllgv" != 0.0)
mean( "AADTTaxi" , "DESC_TERM" , "AADTTaxi" != 0.0)
mean( "AADTMotorc" , "DESC_TERM" , "AADTMotorc" != 0.0)
mean( "AADTLtBus" , "DESC_TERM" , "AADTLtBus" != 0.0)
I've created this flow on Graphical Modeler:
Where for LGVs (where the model fails);
With the failure message "An error occurred while evaluating the calculation string: Cannot use aggregate function in this context":
What could be going wrong?
I tried changing the parameters, but nothing seems to work.
1 Answer 1
The issue looks solved.
You should update since 2.18.17 is released or try to install nightly from osgeo4w with the advanced install.
mean( "AADTallc_1" , "DESC_TERM" , "AADTallc_1" != 0.0)
under Formula.