I have a multipolygon layer in QGIS 3.4.

enter image description here

Attribute table looks like this.

enter image description here

I want to style each polygon based on column "Percent Ar".

When I open Layer Properties >> Symbology, I choose "Graduated" from the symbol menu. I think that's where I have to go to accomplish what I want...

Anyway, there's nothing in the "Column" field. When I type "Percent Ar" the text turns red. If I click outside the field, the text disappears.

enter image description here

How do I assign the color fill for each polygon based on the "Percent Ar" column?

1 Answer 1


Your problem is that all of your columns have been imported as text fields, and so they are not recognized as being numeric. You can tell this by the fact that all of contents of the cells in the attribute table are left-justified instead of right-justified.

Create a new field by opening the attribute table, starting an edit session, and clicking on the "New Field" button. Set the field's value to to_real("Percent Ar"). This field should then appear in the column selection box.

As a side note, this happens quite often when data is imported from a CSV or other text-based format. Anita Graser wrote a guide on how to deal with it more effectively here.

  • 1
    you can also type the "E" and type the same expression to_real("Percent Ar") without adding any new field.
    – Snaileater
    Commented Mar 16, 2019 at 20:02
  • @snaileater Where would I type that?
    – Username
    Commented Mar 16, 2019 at 21:20
  • Go to the attribute table and click on the "Add Column" button.
    – wfgeo
    Commented Mar 16, 2019 at 21:30
  • Turns out I can type to_real("Percent Ar") into the column field. If you add that to your answer, I'll check it off. That's the solution I used.
    – Username
    Commented Mar 16, 2019 at 21:47
  • I added the part about clicking on the "Add Field" button.
    – wfgeo
    Commented Mar 16, 2019 at 23:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.