I have bathimetry data in .shp format. The points (picture below shows one of multiple groups/profiles) do not have ID numbers and are randomly dispersed through the attribute table. [![enter image description here][1]][1] [![enter image description here][2]][2] I have selected each group and added group ID to it. Now each point has "Sort" attribute that serves as the group ID. I still need each individual point to have ID number within the group. I need these points numbered starting with the northernmost point in group (Field2 in attribute table is northing) and ending with the southernmost. So, a point with highest "Field2" value gets value of 1 in "point_num" field. Basically, what I need to do is sort selected points according to value of "Field2" attribute. How can I do this with (preferably) QGIS field calculator or some other tool? [1]: https://i.sstatic.net/WTUks.png [2]: https://i.sstatic.net/UtrS4.png