I have a QGIS file (see img attached) and I want to calculate the same as Area_HA only with CODE_06 between 100 and 500. I can't find the expression to add to the field calculator.

enter image description here

yes, I want to calculate the area in Ha for every objects that have CODE_06 bellow 500

  • The question is a bit misleading. You are not performing an aggregation, but a field calculation based on a condition.
    – Matt
    Jan 24, 2022 at 11:25
  • When you say "aggregate" do you want to calculate the TOTAL area for every object that meets the condition (i.e. one area for all objects meeting the condition)? Jan 24, 2022 at 23:09

1 Answer 1


If I understood you right, you use an expression that looks like:

if ("Code_06" <= 500 AND "Code_06" >= 100, $area, '')

  • Oh yeah exaclty!!! do you know how to do this operation in batch? meaning on several layers
    – Robagb
    Feb 4, 2022 at 9:44

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.