I have a layer of points and I want to add a column with an index according to the coordinates. I already thought about sorting the UTMX and UTMY coordinates, but still the result doesn't convince me, so I tried to multiply these coordinates to get a third column and sort this one. Likewise, I am not sure if this is the result I am looking for, so is there a simpler way in QGIS?.
Here is an image of the layer with the indexes to order, the idea is from left to right or from one corner to the other.
The result would have to look like this for the example from top left to bottom right.


array_find(array_agg($id,order_by:=to_string($x)||'_'||to_string($y)),$id)? Otherwise please provide exact informations on how to sort the points. – MrXsquared Jun 02 '22 at 13:52