When I try to do a field calculation from the Processing Toolbox in QGIS 3 it performs the calculation on all records instead of the selected records. Is there a way to have the calculation performed only on the selected records using the Processing Toolbox Field Calculator?

The field calculator from the menu bar includes an option to "Only update [X] selected records" but that is missing from the Processing Toolbox.

Here's the dialog box from the Processing Toolbox: Processing Toolbox Field Calcator

Here's from the menu bar (and the attribute table)

Menu Bar Field Calculator

I'm ultimately setting this all up in the Graphical Modeler so if there's a work around that fits there, that's ok.

2 Answers 2


You can use is_selected() function in if statement to perform calculation on just selected features.

enter image description here


May be update to QGIS 3.2. It works at me

enter image description here enter image description here


In the Processing toolbox, it works with an extraction (but not with a selection). I don't understand the difference

enter image description here

  • Sorry, i have read the message form @JS_UNC too rapidly. May be my edit can help him Jul 31, 2018 at 12:54
  • 1
    Interesting. As I understand it Extraction creates two layers from an input layer, so it makes sense that then the field calculator would work on the extracted layer because it is still performing the calculation on all records - this time its the records in the extracted layer.
    – JS_UNC
    Jul 31, 2018 at 13:36

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.