I'm working on a big data set, with 385'000 features. Each feature is the centroid of a polygon, and I'd like to assign a value to each of them. I've used the @row_numberin the field calculator to do so (QGIS 3.10). It works perfectly until the row 235'262 and then for not apparent reason, the following row is labelled "NULL". Any insight on what I may be doing wrong?

enter image description here

  • 1
    Maybe the Field Calculator has a limit on the number of features it can update. Try selecting the rows that didn't get a value (use the tool select by expression with the expression "yourfieldname" is NULL), then use the Field Calculator again, with the same calculation and tick the box for "apply changes to selected features only".
    – csk
    Feb 3 '20 at 17:28
  • 1
    What version of QQIS are you using?
    – GreyHippo
    Feb 3 '20 at 17:31
  • 3
    What properties have the field you are updating ? it could be a limitation of the field type or properties (for exemple the short integer data type have a max value of 32,767)
    – J.R
    Feb 3 '20 at 17:51
  • @J.R the properties of the field are: whole number (integer), Length: 6
    – Tim56
    Feb 4 '20 at 8:34

I've sorted this out using a different method. I saved my dataset into a Geopackage, and has automatically created a fid field. Row 1 now has 1 in the fid field such as in the picture below:

enter image description here

Your Answer

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

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