I have a shapefile with a categorical field (cat) and an integer field (value) in QGIS.
I want to create a new field (group), that groups incremental values per category until there is a break/gap into a new 'group' field. The group field needs to a unique integer per group - this field does not need to be incremental.
Below is an example of what I am after, I would need to generate the 'group' field as follows:
| cat | value | group |
|---|---|---|
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| 1 | 2 | 1 |
| 1 | 4 | 2 |
| 1 | 5 | 2 |
| 2 | 0 | 3 |
| 2 | 1 | 3 |
| 2 | 2 | 3 |
| 3 | 3 | 4 |
is there a way to do this using field calculator?

