Kirix Support Forums

delete matching data

Please post any help questions, requests or other feedback here.

delete matching data

Postby TillyDoyle on Wed Aug 17, 2011 4:38 am

I have 2 tables, the smaller one (7000records) is an extract of the main data set (49krecords). I want to delete the records in the main dataset that match the records in the smaller one. I have linked them but cannot fathom out how to proceed?
Many thanks.
TillyDoyle
Registered User
 
Posts: 4
Joined: Wed Jul 20, 2011 4:17 am

Re: delete matching data

Postby Ken on Wed Aug 17, 2011 1:21 pm

Try this:

1) Reverse the Parent/Child relationship in this case (you can delete from a parent, but not from a child).

2) In your parent table, create a calculated field with this format:

!empty(<table>.<field>)

[where "table" is the table name and "field" is the field name that you related on]

This will give you a "T" for true or and "F" for false... basically the forumla says: Is the field in the child table not empty? If so, place a "T" in the field for true.

3) Once you know which fields are not empty, you can delete all those fields (to do it in one go, make the calculated field "fixed" and then you can right-click, hit delete records for the formula "=F"). The remaining ones are "empty", so they must be unique.

Before you do this though, I STRONGLY recommend making copies of both tables so you can test things out without fear that you'll delete the wrong data.
Ken Kaczmarek
Kirix Support Team
User avatar
Ken
Kirix Support Team
 
Posts: 147
Joined: Mon Dec 19, 2005 10:36 am

Return to Strata Help & Feedback