I'm working with an attribute table whose one of the fields (Id) has several repeated numbers, is there a formula in which I can order these repeated numbers, or something like that, so I can delete them more easily? I am working with QGIS 3.28.4
-
Are you just wanting to delete all the duplicates or selected to check first?– ScoGerCommented Mar 15, 2023 at 21:25
-
2You should provide more information about 1) how your "repeated numbers" look like initially and 2) how they should look like afterwards. Without more information, no answer is possible. Best post sample data or a screenshot.– BabelCommented Mar 15, 2023 at 21:33
-
I just want to delete all the diplicates numbers (that represent repeating points)– Carlos PastorelloCommented Mar 15, 2023 at 21:57
-
Sorry, if you don't post an example of how your input looks, you probably won't get an answer or the question even risks to be closed. You can click the edit button to insert further information there– BabelCommented Mar 15, 2023 at 22:31
-
1Does this answer your question? Identifying duplicate attributes in field using QGIS– she_weedsCommented Mar 18, 2023 at 0:48
2 Answers
You can count the order of occurrence of every attribute value using this expression in Field calculator (let's say, you want to count the order for the attribute "Id" and write it in the "order" attribute):
array_find(
array_agg($id, group_by:="Id"),
$id
) + 1
The result is:
After that you can select the duplicates with the expression:
"order" > 1
Hope this helps!
You can create a new virtual field with the condition:
count(id, group_by:= id )
This condition will return a value that is repeated several times. And then search for them using the filter.
Hope this makes it easier to solve the problem