QGIS Attribute Table Percentage – How to Display Data in Percentage in the Attribute Table in QGIS

attribute-tablecalculate-valuesqgis

I'm trying to figure out how to display one attribute column in percentages. I've created a new field inside the attribute table and proceeded with:

concat("column with numbers to be changed in percentage", '%')

But the output displays NULL. Any insight on what I may be doing wrong?

Best Answer

Given decimal values in a double precision column (or other), you can use an expression to:

  • multiply the value by 100
  • round the value to 0 decimal places
  • concatenate the % sign at the end of the value

In a label expression, this is what I would do:

(my percent column is called "rating")

round(("rating"*100), 0) || '%'

I use the label expression rather than creating a new column of otherwise redundant data.

enter image description here

Here I've added both the original column and the percent-formatted column on two lines of the label:

"rating" ||  '\n' ||
round(("rating"*100), 0) || '%'
Related Question