Is there a way to number a subset of entries in the attribute table based on the current sorting in Qgis? e.g. select all entries with attribute X, sort them by abttribute Y, create a new column and fill the column (only for the selected and sorted values) whith 1 to n; not rownum or id.
I guess you might have a solution in QGIS 3.2 with a new feature added, thanks to Nyall Dawson (North Road). I haven't tried, but i guess oyou could try filtering the layer before running this new tool ?
Feature: Sort order option for "Add Incremental Field"
This change allows users to optionally set a sort order to use when assigning values in the Add Incremental Field algorithm. Previously values were always added using the original feature order. With this change users can control the order in which features are assigned values.