I have a shapefile containing population data for Baltic countries. Using the SQL formula: $rownum in the field calculator, I was able to create an automatic numbering of rows (far right on the picture below), from 1 to the end of my table. However, for no apparent reason, the numbering is broken at row 129 and switches to 766. It changed at the exact place where I have a new country, so maybe it is linked.

Any reason why this happens?

enter image description here

  • 1
    Please Edit the question to specify the source format of the data table. If it is a database, please specify which one (name and version).
    – Vince
    Jan 10 '19 at 14:49
  • 4
    As far as I can see your table is sorted by country, but the ids re generated in the order of storing. Try to sort table by the unique id, I suppose there will be no break. The code page of the table is not correct, you can change it in the properties of the layer, on the source tab.
    – Zoltan
    Jan 10 '19 at 15:58
  • 2
    If @Zoltan suggestion does not solve it, you can take a look into the .dbf file with e.g. libre office calc and check whether there is something wrong or missing.
    – MrXsquared
    Jan 10 '19 at 17:37
  • 3
    since you are working with a sorted table, try this: gis.stackexchange.com/questions/192048/…
    – Vale
    Jan 11 '19 at 9:18

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.