So I want to change one of the columns in my table from string to real. How am I supposed to do that?

marked as duplicate by underdark qgis Jul 12 '17 at 18:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    If the data is all real you do not need to change the field type, use to_real (field) – pigreco Jul 12 '17 at 16:43

Use Refactor Field in the Processing Toolbox.

Go to Processing > Toolbox > QGIS geoalgorithms > Vector table tools > Refactor fields

Processing Toolbox - Refactor fields

This will open the Refactor fields window where you can select the layer that you want to make changes to.

enter image description here

From the Type drop down choose Integer or Double depending if you want a whole number or a decimal number, respectively, and choose the length.

enter image description here

You can choose to save the new altered layer to a location or if you leave it as default 'Save to temporary file' then 'Save as' the new 'Refactored' layer that is loaded into your project.

  • Ok, so I have done everything that you have said, but there remains a problem, after I converted my table into a new refactored layer, I am unable to use one of the refactored columns as an interval for graduated styling, how can I fix this? – Shuryu Kisuke Jul 12 '17 at 18:56
  • This is a different question. Try searching for an answer on GIS Stack Exchange, or otherwise on the internet. If there is no answer you can find that helps then you can post a new question explaining what you are trying to do, and what you have tried. Does this help perhaps gis.stackexchange.com/questions/175633/… – Martin Hügi Jul 12 '17 at 19:18
  • I have fixed my problem now, there are two double options in my refactoring interface, its the top one that works. – Shuryu Kisuke Jul 12 '17 at 19:22

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