I have a table with two fields: "NUMBER"
(integer) and "TOWN"
(text).
I would like to find an expression that fills the "NUMBER"
field with an automatic number specific for each value of "TOWN"
.
Example:
NUMBER | TOWN
----------------------
1 | STRASBOURG
2 | STRASBOURG
3 | STRASBOURG
1 | PARIS
2 | PARIS
1 | TOULOUSE
2 | TOULOUSE
3 | TOULOUSE
4 | TOULOUSE
How can I do that with a QGIS expression?