* Ordering Individuals by DOB

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
RogerF
Famous
Posts: 182
Joined: 26 Apr 2009 16:32
Family Historian: V6.2
Location: Oxfordshire, England
Contact:

Ordering Individuals by DOB

Post by RogerF » 06 Nov 2017 21:52

Looking at the Individuals window, displayed ordered by Dates, it would be very useful if the records were presented in a consistent order: that is (for each year) births in that year, then that year (approximately), finally that year (estimated). Currently, the order within each year seems to be fairly random. Have I missed some config option which would give what I want?
Attachments
Capture15.PNG
Capture15.PNG (9.39 KiB) Viewed 4297 times
Roger Firth, using FH to research the FIRTHs of Lancashire and Yorkshire, and the residents of the market town where I live.

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Ordering Individuals by DOB

Post by tatewise » 06 Nov 2017 23:06

The Dates column is usually defined as =LifeDates(,STD) which is a summary of life dates that may include Date of Birth, Baptism, Christening, Death, Burial or Cremation.

I think you will find that they are sorted according to the full date, taking the day & month into account as well as year.
Those without a day or month will assume the 1st and January respectively.

If it were defined as =Text(LifeDates(,STD)) then the displayed text will be sorted strictly alphanumerically.
But that will group all bap. dates, then chr. dates, and then c. dates together after all the numerical years.

It might be possible to construct an Expression that shows just the Year of Birth/Baptism/Christening followed by whether Approx, Calculated, or Estimated, but gets quite involved with several nested TextIf(...) functions.
e.g.
=TextIf( Exists(%INDI.BIRT.DATE%), Text( Text(Year(%INDI.BIRT.DATE%)) . " " . TextIf( %INDI.BIRT.DATE:XDATETYPE% = "Date", "", Text(%INDI.BIRT.DATE:XDATETYPE%) ) ), TextIf( Exists(%INDI.BAPM.DATE%), Text( Text(Year(%INDI.BAPM.DATE%)) . " " . TextIf( %INDI.BAPM.DATE:XDATETYPE% = "Date", "", Text(%INDI.BAPM.DATE:XDATETYPE%) ) . " bap." ), TextIf( Exists(%INDI.CHR.DATE%), Text( Text(Year(%INDI.CHR.DATE%)) . " " . TextIf( %INDI.CHR.DATE:XDATETYPE% = "Date", "", Text(%INDI.CHR.DATE:XDATETYPE%) ) . " chr." ), "" ) ) )
i.e.
If Birth Date then show Birth Year & Birth Date Type
else
if Bapt Date then show Bapt Year & Bapt Date Type & " bap."
else
if Chr Date then show Chr Year & Chr Type & " chr."

BUT that Expression is greater than the maximum characters allowed for a Column!
So this one is just short enough, although not quite so tidy:
=TextIf(Exists(%INDI.BIRT.DATE%),Text(Text(Year(%INDI.BIRT.DATE%)).TextIf(%INDI.BIRT.DATE:XDATETYPE%="Date","",Text(%INDI.BIRT.DATE:XDATETYPE%))),TextIf(Exists(%INDI.BAPM.DATE%),Text(Text(Year(%INDI.BAPM.DATE%)).TextIf(%INDI.BAPM.DATE:XDATETYPE%="Date","",Text(%INDI.BAPM.DATE:XDATETYPE%))." bap"),TextIf(Exists(%INDI.CHR.DATE%),Text(Text(Year(%INDI.CHR.DATE%)).TextIf(%INDI.CHR.DATE:XDATETYPE%="Date","",Text(%INDI.CHR.DATE:XDATETYPE%))." chr"),"")))
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
RogerF
Famous
Posts: 182
Joined: 26 Apr 2009 16:32
Family Historian: V6.2
Location: Oxfordshire, England
Contact:

Re: Ordering Individuals by DOB

Post by RogerF » 07 Nov 2017 08:03

Thanks, Mike. It should be possible to simplify matters: everybody in my database has a DOB; if I haven't yet discovered a true date I supply an estimate. So we need look only at%INDI.BIRT.DATE%; perhaps something like:

=TextIf( Exists(%INDI.BIRT.DATE%), Text( Text(Year(%INDI.BIRT.DATE%)) . " " . Text(%INDI.BIRT.DATE:XDATETYPE%) ) ), , "" ) ) )

but I'm unsure about the bit at the end, and clearly the parentheses are unbalanced.
Roger Firth, using FH to research the FIRTHs of Lancashire and Yorkshire, and the residents of the market town where I live.

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Ordering Individuals by DOB

Post by tatewise » 07 Nov 2017 10:12

Roger, if only interested in DoB then you don't need the =TextIf(...) at all, just the Text(...) function.
i.e.
=Text( Text(Year(%INDI.BIRT.DATE%)) . " " . %INDI.BIRT.DATE:XDATETYPE% )

That is OK even if there is no DoB and just yields a single space.

However, the XDATETYPE qualifier not only yields Approx, Calculated & Estimated, but also Date for a simple date, and Before or After or Between for a Range or Quarter Date, so the order for identical years would be:
After
Approx
Before
Between
Calculated
Date
Estimated

To eliminate Date so simple dates come first , replace %INDI.BIRT.DATE:XDATETYPE% with:
TextIf( %INDI.BIRT.DATE:XDATETYPE% = "Date", "", Text(%INDI.BIRT.DATE:XDATETYPE%) )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
RogerF
Famous
Posts: 182
Joined: 26 Apr 2009 16:32
Family Historian: V6.2
Location: Oxfordshire, England
Contact:

Re: Ordering Individuals by DOB

Post by RogerF » 07 Nov 2017 10:31

Excellent! Thanks again, Mike.
Roger Firth, using FH to research the FIRTHs of Lancashire and Yorkshire, and the residents of the market town where I live.

Post Reply