* Using flags to indicate...

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
Post Reply
User avatar
wulliam
Famous
Posts: 122
Joined: 03 Oct 2009 10:29
Family Historian: V6.2
Contact:

Using flags to indicate...

Post by wulliam » 07 Dec 2014 20:43

Is it possible to write an expression for use in diagrams so that the following happens?:

I would like an individual's box to be formatted if any of their direct ancestors has the flag 'direct'.
For example, in the following image Torquil Macleod is the descendant of a direct ancestor of mine:

Image

I'd like to be able to show that fact on the diagram automatically - all my direct ancestors already have a suitable flag showing them to be such.

Hope that is clear...thanks for taking time to read this.
William

User avatar
tatewise
Megastar
Posts: 18917
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Using flags to indicate...

Post by tatewise » 07 Dec 2014 22:08

I am not absolutely certain, but I think I might be able to do even better.

I assume that you will always be the FileRoot().
If so I think the following Expression is true if an Individual is a direct Descendant of one of your direct Ancestors and needs no Flags to be set at all.

=IsTrue( ( RelationCode(FileRoot(),%INDI%,SPOUSE_START,1) = 0 ) and ( RelationCode(FileRoot(),%INDI%,SPOUSE_END,1) = 0 ) )

It works for two reasons.

(1) Totally unrelated Individuals return no numeric value at all for either RelationCode().

(2) Spouses of direct relations return the numeric value 1 for either RelationCode().

Thus only Individuals directly related to FileRoot() return 0 for both RelationCode() functions.

If you don't want it dependent on FileRoot() but on you specifically then use Record(9,"I") instead where the digit is your Record Id.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
wulliam
Famous
Posts: 122
Joined: 03 Oct 2009 10:29
Family Historian: V6.2
Contact:

Re: Using flags to indicate...

Post by wulliam » 08 Dec 2014 17:20

Hi Mike - thanks for that...have been at work all day and only now managing to think about your answer.

I've tried it and it seems to work very nicely with one odd exception on the image shown below:

Image

Isabella Murray and her various children are correctly tagged (I've used red font). Torquil, because of one of his own ancestors, is also correctly tagged. But for some reason Isabella's oldest child Mary isn't tagged - can't figure out why. Any thoughts gratefully received though I'll see if I can work it out this evening.

For what it's worth, I've used the ID number of my son, so that this works for all his ancestors rather than just those on my side of the family, and I frequently change the file root depending upon which part of the family I'm working on.

Thanks for the time you've already spent on this.
William

User avatar
tatewise
Megastar
Posts: 18917
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Using flags to indicate...

Post by tatewise » 08 Dec 2014 19:34

The functions are working on the closest relationship, as indicated by the last parameter 1.

Presumably, Mary's relationship through her husband Torquil is closer than through her mother Isabella.
So the exclusion of spouses of that closer relationship takes precedence.

I suspect the following expression that also checks 2nd closest relationships will fix the problem:

=IsTrue( ( ( RelationCode(Record(9,"I"),%INDI%,SPOUSE_START,1) = 0 ) and ( RelationCode(Record(9,"I"),%INDI%,SPOUSE_END,1) = 0 ) ) or ( ( RelationCode(Record(9,"I"),%INDI%,SPOUSE_START,2) = 0 ) and ( RelationCode(Record(9,"I"),%INDI%,SPOUSE_END,2) = 0 ) ) )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
wulliam
Famous
Posts: 122
Joined: 03 Oct 2009 10:29
Family Historian: V6.2
Contact:

Re: Using flags to indicate...

Post by wulliam » 08 Dec 2014 19:38

Thanks Mike - that is a thing of beauty!
This will make getting my head around some complex village relationships an awful lot easier :)

Kind regards,
William

User avatar
johnmorrisoniom
Megastar
Posts: 792
Joined: 18 Dec 2008 07:40
Family Historian: V6.2
Location: Isle of Man

Re: Using flags to indicate...

Post by johnmorrisoniom » 08 Dec 2014 21:00

I use the expression:
=IsRelativeOf(FileRoot(),%INDI%)
to put a green border around boxes of relatives, and find this works very well

User avatar
tatewise
Megastar
Posts: 18917
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Using flags to indicate...

Post by tatewise » 08 Dec 2014 21:44

I think that includes spouses that William wants to exclude, but I am happy to be proved wrong.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply