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.
* Query for Fact, Location and Related To
- 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
Gary
Win 10, FH 7.0.15
Win 10, FH 7.0.15
- 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
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
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
- 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
Where in the sequence of expressions do I add this? Beginning or end or someplace else?
Gary
Win 10, FH 7.0.15
Win 10, FH 7.0.15
- 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
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
Win 10, FH 7.0.15
- 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
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.
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
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA