* Query for Fact, Location and Related To

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Query for Fact, Location and Related To

Post by Gary Carson » 17 Jan 2018 20:27

I have developed a query to select based on selected facts and distance from a place

Condition Expression Operator Value Parm. Parameter Label
Add if =FactLabel(%FACT%) Matches Birth No
Add if =FactLabel(%FACT%) Matches Mariae No
Add if =FactLabel(%FACT%) Matches Death No
Add if =FactLabel(%FACT%) Matches Burial No
Exclude unless =DistanceBetween(,[Place: "Place"],MILES) Is less than 5 Yes Max. Distance (miles)

This gives me all the facts for all the people within the specified distance.

Output columns include =FactLabel(%FACT%), %FACT.DATE:COMPACT%, %FACT.PLAC>%, =FactValue(%FACT%), =Field(FactOwner(%FACT%,1,MALES_FIRST),'INDI.NAME:SURNAME_FIRST'), =Field(FactOwner(%FACT%,2,MALES_FIRST),'INDI.NAME:SURNAME_FIRST') and =DistanceBetween(,[Place: "Place"],MILES)

Now I want the results to be for the same facts AND only for persons related to a specific individual. How do I add that additional selection criteria. I will then generate a map of the output.
Gary
Win 10, FH 7.0.15

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Query for Fact, Location and Related To

Post by tatewise » 17 Jan 2018 21:12

You need to compare the selected person with the owner of the fact.
e.g.
Exclude unless =IsRelativeOf(["Root Person"],FactOwner(%FACT%,1,MALES_FIRST)) is true

That will prompt for Root Person but you could specify a particular person by Rec Id or use FileRoot().

You may also need to cater for the other partner in Marriage events by using:
Exclude unless =IsTrue(IsRelativeOf(["Root Person"],FactOwner(%FACT%,1,MALES_FIRST)) or IsRelativeOf(["Root Person"],FactOwner(%FACT%,2,MALES_FIRST))) is true

There are also functions for =IsAncestorOf(...) and =IsDescendantOf(...) if you prefer.

Be aware that those functions work similar to Diagrams and so =IsRelativeOf(...) will NOT include all relatives by marriage.
So to include all those you need to compare the Pool number of the individuals instead.
e.g.
Exclude unless =IsTrue(RelationPool(["Root Person"]) = RelationPool(FactOwner(%FACT%,1,MALES_FIRST))) is true
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Re: Query for Fact, Location and Related To

Post by Gary Carson » 17 Jan 2018 21:29

Where in the sequence of expressions do I add this? Beginning or end or someplace else?
Gary
Win 10, FH 7.0.15

User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Re: Query for Fact, Location and Related To

Post by Gary Carson » 17 Jan 2018 21:40

Also, what expression do I use if I want to add relationship to Root Person in output column?
Gary
Win 10, FH 7.0.15

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Query for Fact, Location and Related To

Post by tatewise » 17 Jan 2018 22:02

Add the Exclude unless after the Add if =FactLabel(...) rules.
Does not matter whether before or after Exclude unless =DistanceBetween(...) rule.

Add two columns:
Relationship 1
=Relationship(["Root Person"],FactOwner(%FACT%,1,MALES_FIRST),TEXT,1)

and
Relationship 2
=Relationship(["Root Person"],FactOwner(%FACT%,2,MALES_FIRST),TEXT,1)


Where this second one caters for Fact Owner 2 in Marriage events.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Re: Query for Fact, Location and Related To

Post by Gary Carson » 18 Jan 2018 00:53

Thanks much Mike.
Gary
Win 10, FH 7.0.15

Post Reply