I am trying to convert a field that is listed as "String" because it was imported into QGIS as a CSV (rural poverty population percentages by county in NC). I need to convert the percentages field from "string" to "Real" with at least one tenths decimal place. I have been using the field calculator to create a new field with a data type conversion (toreal( "Field_Name")) with the precision at 2 (for 2 decimal places I am assuming). The expression is valid and I am able to get a result as a new field. The problem is that I keep getting resulting values from the adjacent column to the one that I am trying to convert. I get real numbers with 2 decimal places but from a column next to the one I am trying to convert! (This adjacent field happens to be a "string" data type (RCU codes) so I am definitely not mistaking the data in it's converted state.

Has anyone had a problem with the field calculator and it selecting a different field that the one you have identified in the conversion expression?

  • What are the values you get from the adjacent column? Perhaps you can include a screenshot? – Joseph Oct 9 '14 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.