I am working with vegetation types within a project site. Each vegetation type belongs to a broader group termed a "vegetation group"
. For example, in the screen shot below, I have the two vegetation types 'WC1' and 'WC2' which belong to the 'Wet Coniferous Forest Group'.
Is there a way by expression to populate a new column with the the appropriate vegetation group based on the vegetation types in a column? In this example, all 'WC1' and 'WC2' would be in the 'Wet Coniferous Forest Group' which would be in a new column.
Best Answer
Use the Field calculator with a CASE-statement. The expression looks like this, where
"vegetation_type"
is the name of the field containing theWC1
,WC2
values:Before the
end
statement, you can add as many similarwhen ... then
statements as you like:You can also add an
else
statement that returns the output in all other cases, something likeelse 'other'
. Add this after the lastwhen
statement, beforeend
: