I have a point layer with features that are along a separate line layer, and have calculated the points' distance along the line using line_locate_point(aggregate('Line','collect',$geometry),$geometry). The values are stored in a virtual field named loc in the point layer.
Now I want to be able to sequentially renumber the points along the line based on loc. How can I do this purely in QGIS, without creating a new layer (i.e. so not using something like Sort and Number)?
I tried using scale_linear() but this is not the appropriate tool (see results below - I would like testno to go 1,2,3,4...)
I'm aware there is an easy solution in PostGIS using rank() OVER PARTITION BY but I'm using spatialite and I don't think rank() exists. I can't get it to work.
The quick and dirty alternative is to save loc as a proper field, save as shapefile and renumber appropriately by opening the .dbf in Excel, but I'd prefer to find a solution that works entirely in QGIS without extra plugins if possible.
