0

I'm looking for a workaround or trick to calculate row_number function for more than 100 category in one step rather than do it manually for each category by QGIS.

Update: I have POIs layer and in sub_category field contains more than 100 values, I want to calculate row_ number for each this category automatically rather than one by one.

GIS Man
  • 1,123
  • 2
  • 12
  • 32
  • This isn't clear to me. Do you want to replace categories with numbers? Or add row numbers to records, but counting each category separately? Or something else? Can you show an example input and the correct output? – Spacedman Sep 28 '21 at 11:21
  • isnt @row_number the same for all categories? Take a look into in refactor fields as batch process or pyqgis solutions. – MrXsquared Sep 28 '21 at 11:23
  • 1
    Or are you looking for something like this: https://gis.stackexchange.com/questions/376724/increment-value-based-on-grouped-field? – MrXsquared Sep 28 '21 at 11:27
  • I added more details – GIS Man Sep 28 '21 at 11:31
  • Thank you very much @MrXsquared, yeah that is what I want but if possible to restart the increment for each category, it will be great. – GIS Man Sep 28 '21 at 11:43
  • You just need to replace "BUILDING" with the fieldname of your category-field in the expression from the answer. That should do it. – MrXsquared Sep 28 '21 at 11:47
  • Yeah I did it, but unfortunately "BUILDING" field on the other hand in my layer it contains words not numbers – GIS Man Sep 28 '21 at 11:49
  • 1
    Sorry bro, it's working fine – GIS Man Sep 28 '21 at 11:57
  • Thank you very much – GIS Man Sep 28 '21 at 11:57

0 Answers0