3

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?

"P:\Allgemeines\Transfer\Rayk\Übermittlung LK\Screenshot 2021-08-13 131612 cut.jpg"

1 Answer 1

2

According to https://github.com/qgis/QGIS/issues/39119#issuecomment-768642727 this is currently not possible as those variables do not update in the scope of the model.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.