[GIS] Adding text to end of existing value in QGIS

attribute-tableexpressionfield-calculatorfields-attributesqgis

I have a column in a large attribute table. The values in this column are numeric value.

Example entries in this case would be:

1, 2.0512, 8.5744, 8.944

How can I add the word 'm' to the end of each entry so it'd look like:

1m, 2.0512m, 8.5744m, 8.944m

I don't want to use the technique of sorting them, then selecting them, then using field calculator to define them. I just want to know how to add text at the end of existing value, no matter what the existing value is.

Best Answer

If your original field is a string-type field, you can update it instead of creating a new field.

Use the Field Calculator to update an existing field

  • Check the box next to "Update existing field"
  • Select "oldfield" from the dropdown menu
  • Use this expression* concat("oldfield", 'm')

enter image description here


If your original field type is numerical, you can't add text to it. Instead you have to add a new string-type field.

Use the Field Calculator to create a new field.

  • Output field type: text(string)
  • Use this expression* concat("oldfield", 'm')

enter image description here


*Substitute the actual name of your field where I used the value "oldfield"

Related Question