Page 1 of 1
Using flags to indicate...
Posted: 07 Dec 2014 20:43
by wulliam
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:
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.
Re: Using flags to indicate...
Posted: 07 Dec 2014 22:08
by tatewise
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.
Re: Using flags to indicate...
Posted: 08 Dec 2014 17:20
by wulliam
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:
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.
Re: Using flags to indicate...
Posted: 08 Dec 2014 19:34
by tatewise
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 ) ) )
Re: Using flags to indicate...
Posted: 08 Dec 2014 19:38
by wulliam
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,
Re: Using flags to indicate...
Posted: 08 Dec 2014 21:00
by johnmorrisoniom
I use the expression:
=IsRelativeOf(FileRoot(),%INDI%)
to put a green border around boxes of relatives, and find this works very well
Re: Using flags to indicate...
Posted: 08 Dec 2014 21:44
by tatewise
I think that includes spouses that William wants to exclude, but I am happy to be proved wrong.