0

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

6
  • Are you just wanting to delete all the duplicates or selected to check first?
    – ScoGer
    Commented Mar 15, 2023 at 21:25
  • 2
    You 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.
    – Babel
    Commented Mar 15, 2023 at 21:33
  • I just want to delete all the diplicates numbers (that represent repeating points) Commented 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
    – Babel
    Commented Mar 15, 2023 at 22:31
  • 1
    Does this answer your question? Identifying duplicate attributes in field using QGIS
    – she_weeds
    Commented Mar 18, 2023 at 0:48

2 Answers 2

4

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:

enter image description here

After that you can select the duplicates with the expression:

"order" > 1

Hope this helps!

1

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

enter image description here

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.