I am working in QGIS and trying to create a landcover vector for a project. I have multiple columns with different attributes. As shown below:
I was trying to create a three letter code in the "ECcode"
column using a CASE
statement but it was taking a long time and kind of painful to do. Is there an expression I can use that can simply add the values in the "HCcode"
, "MCCode"
and "ECcode"
columns together so I could get values like "HWDAG"
, "HWDCO"
and so forth?
1 Answer 1
You can simply use the following expression to update the field ECcode
:
upper( "HCcode" || "MCCode " || "LCCcode" )
It will concatenate all the values in the three columns and change the case to uppercase. If you do not want the values to be uppercase, then remove the upper()
expression.
-
1For having a space or a different symbol in between use the
"HCcode" || '-' || "MCCode "
etc.2022年03月07日 06:41:43 +00:00Commented Mar 7, 2022 at 6:41 -
This is great! Thank you.Erioderma– Erioderma2022年03月07日 23:42:14 +00:00Commented Mar 7, 2022 at 23:42
Explore related questions
See similar questions with these tags.