Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I'm using QGIS and I need an expression to change an attribute each X number of rows.
For instance I have the next attribute data:
I want to create an attribute (C) that assigns an ordered value each 3 rows. With the next result:
Assuming your rows are already sorted, you just have to create a new integer field with the expression: ($rownum + 1) / 3
($rownum + 1) / 3
Required, but never shown