We have a data import error where a large number of individuals have two partners, instead of just the one they should have. This causes errors with another system we use that is linked to civicrm. I need to delete the duplicate relationships. Thanks for your help!
-
1unclear if you mean there are duplicate partners - or duplicate relationships to a single partner. if the former you need to merge Contacts.– petednz - fuzion ♦Mar 25, 2019 at 23:37
-
duplicate relationships to a single partner, so a merge does not appear to work– JonbAug 5, 2019 at 16:00
1 Answer
One possibility is to export the Relationship civireport (under Reports - Contact Reports) and then use the power of Excel to analyze it, e.g. pivot on contact_a and relationship-a-b and have it sort by count descending, then anything with 2 or more is a duplicate.
-
yep, there doesnt seem to be a way within CiviCRM to tackle this issue, so using excell or something is required– JonbAug 5, 2019 at 16:00
-
if you are on Drupal you could build a view, aggregate, would then show all those with multiple relationships. in WP you could try the new Views equivalent. but neither of those will actually delete the relationship, so ideally i think you would be doing this direct in mysql and remove the duplicated relationships in the same task– petednz - fuzion ♦Aug 5, 2019 at 19:28