Page 2 of 2
Re: Ancestor/Ahnentafel number
Posted: 14 Nov 2021 10:38
by Little.auk
I have added the "=combine text" expression to my property box - is there a way that I can format the Ahnentafel number to with leading zeros so that it is four character long, so that if I remove the space after the "AN " it will display as "AN0001"
Re: Ancestor/Ahnentafel number
Posted: 14 Nov 2021 11:14
by tatewise
Yes, with the new functions in FH v7.0, this will work, but perhaps the prefix needs an explanation:
=CombineText( LeftText( "AN0000", 6 - TextLen( AhnentafelNumber(FileRoot(),%INDI%,1) ), "" ), AhnentafelNumber(FileRoot(),%INDI%,1), , "AN~" )
The prefix is: LeftText( "AN0000", 6 - TextLen( AhnentafelNumber(FileRoot(),%INDI%,1) ) , "" )
So the number of leading 0's is determined by 6 minus the number of digits in the Ahnentafel number.
The final alternative text when no Ahnentafel number is "AN~" which in a Query Result Set or Records Window Column sorts in ascending order after, i.e. below, the Ahnentafel numbers.
Re: Ancestor/Ahnentafel number
Posted: 14 Nov 2021 12:52
by Little.auk
Thanks Mike,
It is working perfectly, both in the property box and in my custom Ahnentafel query.
I have one question however - in my custom query, in both the standard Ahnentafel number column and the AN0000 column, the characters display as grey text, why is this and is it possible to display them in black, like all the other columns?
Re: Ancestor/Ahnentafel number
Posted: 14 Nov 2021 13:18
by tatewise
The black versus grey text in the Result Set differentiates between clickable data-linked cells and ordinary text cells.
Click the cog Query Menu and choose Options... and then the Colours... button.
There you can <<Select which colour you want to represent those two types of cell text.
Re: Ancestor/Ahnentafel number
Posted: 15 Nov 2021 10:42
by Little.auk
Thanks Mike,
One final question - how do I modify the Ahnentafel expression to work with a FACT based query?
I am trying to create a custom version of the "All Events" query with Ahnentafel Numbers
Re: Ancestor/Ahnentafel number
Posted: 15 Nov 2021 10:51
by tatewise
If you check the standard All Events query you will see the Individual 1/2 Expressions use the FactOwner() function to get the Individual record(s) that own the Event. Just replace the %INDI% parameter with the FactOwner() function.
All the Individual Events such as Birth, Census, Death, etc, only have one Individual 1 owner.
Family Events such as Engagement, Marriage, Divorce, etc, have both owners.
So potentially, you need two Ahnentafel number columns for the Family Events, or if feeling brave could combine them into one column using the Text() function.
Re: Ancestor/Ahnentafel number
Posted: 15 Nov 2021 12:32
by Little.auk
Thanks Mike,
I think one column will do, I want to use the Ahnentafel number to filter and sort Direct Line ancestors, and keep track of my progress on creating sources and linking media files.
When I was using Family Tree Maker I used an Excel spreadsheet, but the Query facilities of FH mean I can query data from within FH (once I master the query language!).
Re: Ancestor/Ahnentafel number
Posted: 15 Nov 2021 13:16
by tatewise
I am not convinced that "one column will do".
If you only check the Ahnentafel Number of the 1st owner of Family Events such as Marriage, then you may miss Direct Line female ancestors whose only Event is a Marriage to somebody who is not a Direct Line male ancestor.
They may not have married the Direct Line male ancestor and may not have Birth or Death events.
Re: Ancestor/Ahnentafel number
Posted: 16 Nov 2021 10:52
by Little.auk
Valid point! - So far I have created three versions of the query, filtered for Births, Marriages and Deaths.
The Birth and Death queries appear to be working with a single column. For the Marriage query I have added two additional columns, to show spouse's name and spouse's Ahnentafel number.
Comparing the outputs of these with my "Ancestors Custom" query I have found a few missing here and there, but that was only happening because there was no relevant "Fact" entered, e.g. I don't appear on the "Death" query -- yet!