Page 1 of 2

Ancestor/Ahnentafel number

Posted: 27 Aug 2020 09:52
by Johnr65
Is it possible to list direct ancestors by the above numbers?

Re: Ancestor/Ahnentafel number

Posted: 27 Aug 2020 10:03
by tatewise
Yes, use the =AhnentafelNumber( FileRoot(), %INDI%, 1 ) function.

If you explain where you want that to appear then I can give more details.

In the Records Window or in a Query or a Named List you add it as a Column Expression.

You can also add it to the Property Box Caption and include it in Diagrams and Reports.

They are used in Ancestor Outline Reports by default.

In Diagrams there is the Name, Dates, Ahnentafel Numbers standard Text Scheme and among the Available Items is Ahnentafel Number which uses the above function.

BTW: Using the FH Help > Search Help... with Ahnentafel finds some of the above options

Re: Ancestor/Ahnentafel number

Posted: 31 Aug 2020 11:35
by Johnr65
Hello Mike,
Yes I can see how that could work but how do I actually set it up to show the ahnenafel numbers and where to put it?

Re: Ancestor/Ahnentafel number

Posted: 31 Aug 2020 11:56
by Gowermick
Important point to remember. The Ahnetafel number displayed will be relative to the Home individual (not your Root), so will alter if you happen to set Home to a different person other than your Root.
To make it static for your direct ancestors, use a custom ID, and use that to store their Ahnentafel number.

Re: Ancestor/Ahnentafel number

Posted: 31 Aug 2020 13:03
by tatewise
@Mike Loney: The Ahnentafel number displayed will be relative to whatever Individual is supplied as the first parameter.
It can be dynamic such as the File Root or the Diagram Root or fixed such as a specific Record Id.
I don't understand what you mean by the Home individual.
The Home button focusses on the File Root so maybe you mean Diagram Root?

@John: If you tell me where you want the Ahnentafel number displayed and which Individual it is to be based on then I can explain how to set it up.
i.e.
Displayed in a Records Window Column, Custom Query, Named List, Property Box Caption, Diagram, Report, etc?
Based on File Root or Diagram Root or somebody else?

Re: Ancestor/Ahnentafel number

Posted: 31 Aug 2020 13:16
by Gowermick
Miketate,
My mistake, I was working from memory, I meant the file root, which can be changed, so not always the root of the tree.
I use it dynamically, so it changes with File Root. I was forgetting you can set it to a specific Record ID. :oops:

Re: Ancestor/Ahnentafel number

Posted: 01 Sep 2020 13:46
by Johnr65
Hello Mike, I'd like it to be where I can easily see it-can it go in the focus box next to the named person? I sho :?: uld like to be the root which I guess is number 1 and my parents 2 & 3 etc?

Re: Ancestor/Ahnentafel number

Posted: 01 Sep 2020 14:41
by tatewise
No, it cannot appear in the Focus Window.
I have listed where it can go, so please choose one or more of those.
I cannot guess where you would easily see it ~ it depends on whether you regularly work in the Records Window or with Diagrams. Perhaps in the Caption at the top of the Individual Property Box?

Saying that you want to be the root does not help me.
Is your record always going to be defined as the File Root?
If not then I need to know your Record Id.

Re: Ancestor/Ahnentafel number

Posted: 01 Sep 2020 15:18
by Gowermick
John,
I too, use the Ahnetafel Number (AN) in my tree, and wanted it displayed. My solution was done in 2 steps.
1. Assign the AN to a custom ID*
2. Adjust property box to display the Custom ID above the name (see screenshot)
3. Add custom ID to display in the caption of the property

* To keep custom ID to same length, I prefixed the AN with a letter, and padded it out to 6 characters.

NB The prefix character forces windows etc to treat it as a string and not a number, and prevents the leading zeroes being dropped. I also modified the columns in the record window to display the custom ID for each Individual.

Re: Ancestor/Ahnentafel number

Posted: 01 Sep 2020 15:31
by arthurk
Another variation, which saves a line in the Property Box:
ak-propbox.jpg
ak-propbox.jpg (27.92 KiB) Viewed 9341 times
(Mine isn't a strict Ahnentafel number, but this is more to show you a layout possibility.)

Re: Ancestor/Ahnentafel number

Posted: 01 Sep 2020 17:15
by tatewise
That is an alternative approach as long as you are prepared to determine the Ahnentafel number for each person by some other method such as using the =AhnentafelNumber( ... ) function in some other display.

Re: Ancestor/Ahnentafel number

Posted: 02 Sep 2020 08:13
by Johnr65
I would like it to appear in the Property Box so that I can see it at a glance please, Mike? I'd thought that the AN reflected the home person (but not file root) which is me as number 1 and that my parents, grandparents and back from them have numbers generated from 1? Can FH generate these AN numbers?
:?: :?:

Re: Ancestor/Ahnentafel number

Posted: 02 Sep 2020 08:39
by trevorrix
I sometimes like the Ahnentafel numbers for each person to display in diagrams.

The method is Diagram Options > Text tab > Edit... . Ahnentafel Number - Calculated is listed in Available Items in the left pane.

Re: Ancestor/Ahnentafel number

Posted: 02 Sep 2020 09:11
by tatewise
The way to show the Ahnentafel number in the Property Box is in the Caption at the top.
So use Tools > Preferences Property Box tab and click the Captions... button.
In the Individual: box at the top add one of the following functions to what is already there:

=CombineText( " AN ",AhnentafelNumber( FileRoot(), %INDI%, 1 ) )

=CombineText( " AN ",AhnentafelNumber( Record(6, "I"), %INDI%, 1 ) )

The first one treats whichever Individual is currently the File Root as the home person.

The second one treats the Individual with Record Id = 6 as the home person, so you must substitute the Record Id of whoever you want to be the home person. I have asked you provide that Record Id but you have not supplied that.

Trevor, thanks for that but I believe that works with respect to the Tree Root person rather than the File Root or a nominated record, although it can be edited to be anyone.

Re: Ancestor/Ahnentafel number

Posted: 03 Sep 2020 10:52
by Johnr65
My own ID is 1, number 6 is a 4th cousin, 3 x removed so not a direct AN ancestor. Is that what you wanted to know Mike?
Do you add that line into the 'Individual' or delete what is in there and add the new line?
You do know Mike surely bu now that I'm hopeless with programming anything!?
:oops: :oops: :cry: :cry:

Re: Ancestor/Ahnentafel number

Posted: 03 Sep 2020 11:23
by Gowermick
tatewise wrote:
02 Sep 2020 09:11

=CombineText( " AN ",AhnentafelNumber( FileRoot(), %INDI%, 1 ) )

=CombineText( " AN ",AhnentafelNumber( Record(6, "I"), %INDI%, 1 ) )

John,
Miketate has inadvertantly confused you.
What he was trying to say was, that if you were the root, you’d could use the first expression. The problem with that expression is that if you change the file root temporarily to someone else, the AN will change too.
To prevent that happening, use the second expression, but to make it work for you, as you have ID of 1, change the 6 for a 1.

So in your case, it should read
=CombineText( " AN ",AhnentafelNumber( Record(1, “I"), %INDI%, 1 ) )

Re: Ancestor/Ahnentafel number

Posted: 03 Sep 2020 11:40
by tatewise
John, I know you are hopeless with programming so I described what to do in detail but you don't seem to have read it because you are asking questions that I pre-empted in my instructions.
tatewise wrote:
02 Sep 2020 09:11
In the Individual: box at the top add one of the following functions to what is already there:
...
you must substitute the Record Id of whoever you want to be the home person.

Re: Ancestor/Ahnentafel number

Posted: 04 Sep 2020 10:44
by Johnr65
My brain hurts and perhaps I've become dyslectic in my old age? I entered what you suggested in the 1st box for 'Individual' and deleted what was there as it wouldn't accept a 2nd entry in the box. However when I applied it the note on the top of the property box said '=CombineText( " AN ",AhnentafelNumber( Record(1, “I"), %INDI%, 1 ) )' but added my name to it and other names similarly. Can't it just say my name and the AN number?
:?: :?: :oops: :oops:

Re: Ancestor/Ahnentafel number

Posted: 04 Sep 2020 11:55
by tatewise
Somehow the first " quote on the “I" is abnormal and that is upsetting the syntax and thus the display.
Maybe you typed that part by hand and got the wrong " quote character by accident?

Copy and paste the following to completely replace the Individual: box contents.

Individual: %INDI% [=RecordId()] =CombineText( " AN ",AhnentafelNumber( Record(1, "I"), %INDI%, 1 ) )

That will disply the Name, [Record Id] and optionally AN with number if the Ahnentafel Number exists.

The =CombineText(...) ensures that AN is only displayed when there is an Ahnentafel Number.

Re: Ancestor/Ahnentafel number

Posted: 05 Sep 2020 10:59
by Johnr65
My brain is still hurting!
I copied the exact phrase as you wrote it, Mike, by copy and paste but it said it's invalid?
:cry: :cry:

Re: Ancestor/Ahnentafel number

Posted: 05 Sep 2020 11:46
by tatewise
What exactly did it say, because I don't recall that feature ever saying anything was invalid.
It simply displays the parts of the expression it does not like in the Property Box Caption.
I wonder if you did not copy the entire expression. Omitting such as the trailing bracket ) will cause it to fail.

Try the following version which has been compacted to remove redundant spaces, so easier to copy without error.
Make sure you delete everything from the Individual: box before-hand just in case you don't overwrite it all.

Individual: %INDI% [=RecordId()]=CombineText(" AN ",AhnentafelNumber(Record(1,"I"),%INDI%,1))

Make sure the Individual: box contents starts with Individual: %INDI% and ends with ,%INDI%,1)) with two brackets.

AhnentafelNumberCaption.png
AhnentafelNumberCaption.png (77.63 KiB) Viewed 9015 times

Re: Ancestor/Ahnentafel number

Posted: 06 Sep 2020 09:35
by Johnr65
Hi Mike, I copied it exactly with 'copy and paste' and it worked OK this time.
Thank you very much for your help and patience.
:D :D :D

Re: Ancestor/Ahnentafel number

Posted: 13 Nov 2021 05:29
by Ozgen
Thanks in advance
Please can someone tell me how to add the Ahnentafel number as a column in the individual records list. I will not be changing the root person who is AN 1. I have managed to copy and paste Mike's expression so it appears at the top of the property box
OzGen

Re: Ancestor/Ahnentafel number

Posted: 13 Nov 2021 05:47
by BillH
Ozgen,

I think this is what you are looking for.

Add a new column by right clicking on any part of the column headings,
Select Configure Columns...,
Double click on <Other...> at the bottom of the left hand pane,
Enter a column heading such as Ahnentafel,
Enter the expression =AhnentafelNumber(FileRoot(), %INDI%, 1)
And click on Add.

The new column will be the last one. You can change the order by using the up and down arrows.

Bill

Re: Ancestor/Ahnentafel number

Posted: 13 Nov 2021 22:30
by Ozgen
Thanks Bill
It worked perfectly
Regards
Sue R