5

I'm having a problem with QGIS. I'm trying to create a new column in the attribute table for a shapefile. The numbers in the fourth column (see screenshots) are currently strings, so I want to convert them into real numbers. This seems to work just fine until I save my edits. Then all the values in the new column become null.

enter image description here enter image description here

It looks like a couple of other people have had this problem (here and here) but they seemed to solve the problem by expanding the width of the output field (from 10 to 20). I tried that, and it didn't make a difference.

Can anyone help?

5
  • Did you try to create the field first, then "update existing field" in the field calculator ?
    – radouxju
    Commented Jan 7, 2014 at 6:42
  • 1
    I think that the NULL values appear only temporarily. If you save edits, close and reopen the attribute table, the values should be OK. Also, consider upgrading to version 2.0. This bug is fixed now.
    – Micha
    Commented Jan 7, 2014 at 8:27
  • Oh, it looks like you're right! Thank you. Will update to the next version too.
    – Restiva
    Commented Jan 7, 2014 at 15:41
  • I'm having this problem and I'm on version 3.4.6
    – user32882
    Commented Apr 21, 2019 at 12:07
  • And I'm having it with 3.6...
    – Unrelated
    Commented Jul 25, 2019 at 22:32

1 Answer 1

1

I had the same problem. The best way of it is running Processing Toolbox -> Refactor fields where just in case you can set up the total length of your column (regardless of its type).

enter image description here

enter image description here

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.