This note describes how to calculate new field values using Field Calculator.

Plugins : None


In this example, we'll convert km² to acres and save the value in a new field.

Before you can add new fields, you have to enable editing:

Then, you can open field calculator:

Now, we can specify the new field that will contain the number of acres 'AREA_ACRE' and the formula used for our conversion:

After pressing 'OK', the new field will be displayed. Note that the number of precision digits is higher than what we chose in the previous dialog. This will be fixed once you stop editing. Only then, the values are written to the attribute table permanently and the precision values are truncated.


Notes :
  1. The field calculator has been exstensively expanded in QGIS 1.8. There are now many more built-in functions and the dialogue has been reorganised.

Attribute_table_toggle_editing.png (57.4 kB) Redmine Admin, 11/23/2011 04:44 pm

Attribute_table_field_calculator.png (52.2 kB) Redmine Admin, 11/23/2011 04:44 pm

Field_calculator_km_acre.png (52.7 kB) Redmine Admin, 11/23/2011 04:44 pm

1-8FieldCalculator.png (54.2 kB) ramon ., 10/25/2012 01:12 am

AttributeTableFieldAdded.png (118.6 kB) ramon ., 10/25/2012 01:12 am