Skip to main content
edited tags; edited title
Link
mgri
  • 16.3k
  • 6
  • 48
  • 80

Delete Deleting duplicate records in the attribute table and keep the minimum value in PyQGIS?

edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Source Link
Jayme Muzzi
  • 365
  • 4
  • 14

Delete duplicate records in the attribute table and keep the minimum value in PyQGIS

I have two fields: ID_PARCEL and NL. The ID_PARCEL is the field that contains duplicate records. I would like to remove the duplicate record by keeping the minimum NL field value. For example: the value 22 in the ID_PARCEL field is duplicated, so the row of the attributes table that should be removed is the one with the highest value in the NL field, which in this case is the value 627.

I searched on the site, but what I found was deleting duplicate records without the condition to keep the minimum value of another field. Can someone help me?

enter image description here