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"

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Aug 13, 2021 at 11:21

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.

answered Nov 4, 2021 at 14:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.