QGIS Attribute Table – Renaming Categorical Attribute Values in QGIS Attribute Table

attribute-tablefield-calculatorfields-attributesqgisrename

Issue

I have a column called ' Species' in a shapefile layer showing the distribution of different species of dolphins. The operator that originally inputted the species names into our excel data sheet wrote two different codes for the same species (for instance, ' Delphinus Delphinus or DD', which both mean common dolphin.

I want to change all the attributes for the common dolphin (currently 'DD' and 'Delphinus Delphinus') in the same column to just 'Delphinus Delphinus' as the categorised option in symbology used to classify my data by species is showing that I have two species 'Delphinus Delphinus and DD' when they are the same species, which is also falsifying the visual representation of dolphin distribution on the map.

Does anyone know how I can change all the attributes in the species column labeled as 'DD' to Delphinus Delphinus?

Best Answer

Just run Field calculator, update the field by typing this expression:

if (
    "Species" in ('DD', 'Delphinus Delphinus'),
    'Delphinus Delphinus',
    "Species"
)

Here I created a new field for demonstration purpose to show the result: enter image description here