Page 1 of 1

Deleting Unused Fact Type

Posted: 07 Mar 2016 04:47
by Gary Carson
Have database with Fact Type that is unused yet appears in a number of individual records. I want to delete that record type from all individual records that have no values. How can I delete without doing each individually?

Re: Deleting Unused Fact Type

Posted: 07 Mar 2016 11:10
by tatewise
You might be able to use the Change Any Fact Tag Plugin from the Plugin Store.

Please clarify by what you mean by 'unused' and 'have no values'.

Perhaps it is an Attribute with no value in the box labelled with its name, above Date & Age?
Whereas other Facts with the same name do have a value in that box?

Or do you mean the Facts have no Date, Age, Place, Address, Note field values?
If so, then do the ones with values that you want to retain always have a Date or Place value?

The reason I ask is the Plugin has Value, Date & Place filters that with a little trickery can detect empty fields, but since you are a newcomer I need to explain how to use them.

Re: Deleting Unused Fact Type

Posted: 07 Mar 2016 13:24
by Gary Carson
The Fact appears in several records. In each of the records I am interested in, there are no entries in any of the fields; thus the entire dialog is empty. I want to delete the empty Facts from the individual records and retain the rest of the individual record. I want to keep other individual records that have values entered in one of the fields.

When I say empty; when looking in the dialog box for the Fact there are no entries in any field.

The Fact I am dealing with currently in a small database is Christened (Standard)
Individual records I want to delete the Fact from have no values in the Date; Age; Place; Address; Note; or Source.

Process could apply to any set of records with a group "empty" Facts.

Re: Deleting Unused Fact Type

Posted: 07 Mar 2016 15:29
by tatewise
OK, actually you can do that with a Custom Query from fhugdownloads:contents:query_all_empty_facts|> Query:Fact ~ All Empty Facts.

Download and install, then use View > Custom Queries > All Empty Facts which will list EVERY empty Fact.
Click on the Label column heading to group similar Facts together.
Select any entries from the Fact column and press the Delete key on your keyboard or use Edit > Delete, heed the warning, and click OK if happy to continue..

Re: Deleting Unused Fact Type

Posted: 07 Mar 2016 17:48
by PeterR
There is a problem with that Custom Query, because the following is evidently not a valid Expression and so cannot be used to exclude rows where the only populated field for Emigration is To.

Code: Select all

=IsTrue(%FACT._PLAC% = "")

Re: Deleting Unused Fact Type

Posted: 07 Mar 2016 18:33
by tatewise
Yes, that is an interesting one, although unlike there would a be a To without a From, and it is listed under Fact column.

I'll look to see if there is a workaround, or maybe needs reporting to Calico Pie.

Re: Deleting Unused Fact Type

Posted: 07 Mar 2016 22:40
by tatewise
Here is a workaround that I will add to the KB Query.
The Rows filter tab needs two more expressions.

Exclude if =IsTrue((FactName(%FACT%) = "Emigration") and Not(%FACT% = "Emigrated")) is true

Exclude if =IsTrue((FactName(%FACT%) = "Immigration") and Not(%FACT% = "Immigrated")) is true

This works because the %FACT% text says Emigrated to <place> or Immigrated from <place> when the To/From field value exists.

[EDIT: It has come to my notice that Fact Query Disallows To/From _PLAC Tag was reported during FH V6 Beta testing early in 2015 and is logged with Calico Pie.]