Bug report #2795

field calculator: correct calculation, but 0s written to table

Added by Paolo Cavallini about 10 years ago. Updated almost 8 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:Vectors
Affected QGIS version:master Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:12855

Description

When calculating (e.g. population/area/1000000), I see the correct results shown on the table, but after saving they are all set to 0

History

#1 Updated by Paolo Cavallini about 10 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

#2 Updated by Alister Hood about 9 years ago

I had a similar experience this afternoon - I added a column, filled in values manually, clicked the save button, closed the attribute table, reopened it, and I think the values were all NULL (not 0). Could it be related?

#3 Updated by Alister Hood about 9 years ago

Actually, I just had it happen after using the field calculator too. The values ended up as NULL.
Am I going crazy?
Do you remember why you decided your report was invalid?

#4 Updated by Jürgen Fischer about 9 years ago

Wrong field type maybe?

#5 Updated by Alister Hood almost 8 years ago

  • Pull Request or Patch supplied set to No
  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

I've just heard a report from someone using QGIS 1.8 of the same problem as in my last comment - I'll open a new ticket if there isn't one already.
I don't believe this is an issue of the wrong field type. Can't that only be an issue if the field calculator puts text in a numerical field (in which case it changes to 0 when it is saved)?

#6 Updated by Alister Hood almost 8 years ago

Alister Hood wrote:

I've just heard a report from someone using QGIS 1.8 of the same problem as in my last comment - I'll open a new ticket if there isn't one already.

#6351

Also available in: Atom PDF