I'd like to create a new field considering duplicate and numeric values.
For example, I have an attribute table with duplicate values in the field1
and numeric values in the field2
. I'd like to create a field3
in which there are the suffix _1
, _2
...on the field1
attributes, when they are duplicates and when "field2">0
.
In case "field2"=0
or not duplicated value in the "field1"
-> "field3"="field1"
.
The suffix should not be set randomly, but following the spatial direction (or left or right); and for each group of duplicated values.
Before:
After:
Any suggestion to use a string in the field calculator to do this in QGIS?