I´ve got a modeler, which has limitation for the input.
I want to build a conditional branch which stops the algorithm when the limit is overstepped.
- "example" - colum with numbers from input layer
- 'Layer A' - Layer contains the maximum of "example" in colum "max_example"
- "max_example" - colum with maximum of "example"
- I use QGIS 3.16.5
With Refactor Fields --> maximum("example") I get Layer A with the colum "max_example" which contains the maximum from the input layer in the colum "max_example"
Now I want the conditional branch to check if the "max_example" ist lower than 17. The code I tried and some other variants with ' ' and " " are:
attribute(get_feature_by_id( @Refactor_Fields_OUTPUT ,'1'),'max_example')<17
attribute(get_feature_by_id( '@Refactor_Fields_OUTPUT' ,'1'),'max_example')<17
attribute(get_feature_by_id( '@Refactor_Fields_OUTPUT' ,'1'),"max_example")<17
The result in the modeler is always NULL. When I try the code in the field calculator and replace '@Refactor_Fields_OUTPUT' with an actual layer it works. Looks like this so far:
attribute(get_feature_by_id( 'Überarbeitet_a9e58d3d_4afa_494d_8be2_3c3bfcad0911' ,'1'),'max_example')
How can I link in the conditional branch to a certain layer and a certain field?