2

I'm adding an id in QGIS with the function @row_number and it is adding the numbers descending, as you see it in the picture. But i need them exactly in the reverse order.

enter image description here

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
user154532
  • 191
  • 9

1 Answers1

6

Try a formula like

TOTAL_NUMBER_OF_RECORD - @row_number

(you may adjust result by adding a -1 or +1 depending if you want to start from 0 or 1)

You may also want to have a look at the Sort and Number plugin :

This plugin adds a new field to an attribute table, where features are numbered depending on multiple sorting criteria.

J.R
  • 16,090
  • 1
  • 19
  • 52