* Source Records Window, Chronological Date Sorting

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
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Source Records Window, Chronological Date Sorting

Post by Chrisv » 22 Apr 2022 18:25

In my Source Records window, I have a date column I would like to be able to sort chronologically. Is there a way to accomplish this?

avatar
Gowermick
Megastar
Posts: 1629
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Source Records Window, Chronological Date Sorting

Post by Gowermick » 22 Apr 2022 18:53

Just click on the column heading to sort into ascending order, and Alt- click for descending order.
This applies to most lists, including query resultsets.
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 22 Apr 2022 19:20

Thank you Gowermick!
If I sort using the Column Header and with the dates in their "normal" format, they do not sort by chronological date because they are listed, for example, as April 19, 1895, which will sort by the Month, Day, Year. I would like them to sort by Year, Month, day, so they are listed chronologically.

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

Re: Source Records Window, Chronological Date Sorting

Post by tatewise » 22 Apr 2022 20:28

Chris, is your date column actually a formal Date column or is it just a Text column that looks like a date?
Please, show us the Expression that defines the column contents.

Only Date fields will sort chronologically. Text fields will sort alphanumerically.

i.e. When you say it sorts by the Month, Day, Year does it sort in this order:
April
August
December
February
January
July
June
March
May
November
October
September
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 22 Apr 2022 20:51

Here you go...
and yes, that is how it is sorting.
Attachments
Date.PNG
Date.PNG (119.28 KiB) Viewed 1710 times

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

Re: Source Records Window, Chronological Date Sorting

Post by tatewise » 22 Apr 2022 21:25

Whoops :oops: I must be mistaken. I was sure that Date fields would sort chronologically.

So one option is to use %SOUR.~DT-EVENT_DATE:ABBREV3% that uses the Short Date Format.

Then in Tools > Preferences > General tab set Preferred Short Date Format to yyyy/mm/dd or yyyy-mm-dd

However, it is still not always strictly chronological because the leading 0 on months and days 1 to 9 are omitted.
So the months Oct (10) to Dec (12) sort between Jan (1) and Feb (2).
The days 10-19 sort between 1 and 2, days 20-29 sort between 2 and 3, and 30-31 sort between 3 and 4.

Therefore, the only complete solution seems to need two columns:
%SOUR.~DT-EVENT_DATE%
=DayNumber(%SOUR.~DT-EVENT_DATE%) is the number of days since January 1st, 0001 AD
Sorting by the 2nd column will put the records in chronological order.

I wonder if the failure to sort Date field columns chronologically should be reported to CP.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 22 Apr 2022 21:44

I could swear that I saw somewhere something about sorting dates - No, wait... It was a way to turn the date field so it would read for e.g. 1884/08/23, or something like that. Or maybe it was somebody wishing it would be that way??
I would think this would be an important option!
Oh well, I appreciate you trying. I will just move on to more important things...
Thanks Mike!

avatar
Gowermick
Megastar
Posts: 1629
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Source Records Window, Chronological Date Sorting

Post by Gowermick » 22 Apr 2022 21:53

Mike,
That is unusual, I always thought it was a standard computing practise to store dates internally as integers, representing days from some inbuilt fixed date. These integers are then converted to the preferred date display option when required i.e US (MMDDYYY) versus UK (DDMMYYY) formats.

This problem doesn’t appear to occur when sorting facts by their dates in the property box, (at least, not that I’ve noticed) :D
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com

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

Re: Source Records Window, Chronological Date Sorting

Post by tatewise » 22 Apr 2022 22:04

There have been various suggestions about achieving yyyy/mm/dd format dates but they all suffer from the leading 0 problem for single-digit months and days.

As Mike suggests, on further investigation, I find standard FH/GEDCOM fields that are specified as Dates do automatically sort chronologically regardless of the display format, e.g. Fact Dates, Citation Entry Dates, etc.
I suspect FH uses the =DayNumber(...) function internally to perform the sorting.

The problem Chris has discovered only affects source template defined Date (DT) metafields.
I really do think it should be reported to CP, as I consider that is an oversight that should be fixed.

FH recognises such Date metafields because it allows Date qualifiers such as :ABBREV3.
So it is just the sorting that has not been implemented.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 22 Apr 2022 22:40

Is this a new problem with FH7, or has this been an omission since FH's inception? It's hard to believe I am the first to run into this, but I did search everywhere and did not come up with any discussions of references.
What is the process to report problems to FH?

User avatar
BillH
Megastar
Posts: 2184
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Source Records Window, Chronological Date Sorting

Post by BillH » 22 Apr 2022 23:10

Chris,

There is a link at the bottom of the support page on the FH website, https://www.family-historian.co.uk/supp ... t-overview.

Here is a direct link to the form for submitting issues, http://support.calico-pie.com/open.php.

Bill

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 22 Apr 2022 23:46

Thank you Bill.
I will fill out the necessary report. Since this is my first time reporting something to CP, would it be a good idea, Mike, if you would also make a much more informed report of the problem? :)

User avatar
BillH
Megastar
Posts: 2184
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Source Records Window, Chronological Date Sorting

Post by BillH » 22 Apr 2022 23:57

Chris,

You can refer to this post in your ticket which has more detail.

If you are not already aware you can click on the asterisk at the beginning of the title for this topic which will create a link and then you can cut and paste that link into your ticket.

image1.jpg
image1.jpg (22.75 KiB) Viewed 1656 times

Bill

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 23 Apr 2022 00:22

I created a support ticket stating the facts as per the conversation in this thread; asking for confirmation of the problem, and that they please consider fixing the problem now, or at least in the next release version.
I'll post what I find out.

User avatar
Mark1834
Megastar
Posts: 2147
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Source Records Window, Chronological Date Sorting

Post by Mark1834 » 23 Apr 2022 08:04

There was a similar issue with Research Notes when they were first introduced (again, a new FH7 feature). The note date was processed as text, so sorted alphabetically rather than chronologically. That was fixed by changing the default Records Window column definition to =Date(GetLabelledText(%_RNOT.TEXT%, "Date:")), i.e. converting the free form text to a date field. That seems to cope well with the scenario of different notes having differently formatted dates so they sort correctly.
Mark Draper

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

Re: Source Records Window, Chronological Date Sorting

Post by tatewise » 23 Apr 2022 09:53

Mark, that problem was resolved by converting Text to a Date and FH then sorted accordingly.
This problem is different. FH already knows the metafield is a Date as it only allows Date Qualifiers like :YEAR, :ABBREV, etc.
The problem is that FH does NOT sort the column as a Date even though it knows it is a Date.
So =Date(%SOUR.~DT-EVENT_DATE%) doesn't help (I tried it) but I had an idea and tried converting the Date to Text and back again =Date( Text (%SOUR.~DT-DATE% ) ) and that seems to work :D
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Chrisv
Famous
Posts: 150
Joined: 18 Mar 2022 17:00
Family Historian: V7
Location: Savannah, GA, USA

Re: Source Records Window, Chronological Date Sorting

Post by Chrisv » 23 Apr 2022 16:42

The wise owl comes through again!
Thank you Mike!

Now, in layman's terms, why did this happen? And not just to me, but to you also??

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

Re: Source Records Window, Chronological Date Sorting

Post by tatewise » 23 Apr 2022 16:48

My solution is a workaround that just happens to work. It should not be necessary to use that trick.

The problem you reported to CP is still a fault that needs to be corrected, and I hope they agree.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Mark1834
Megastar
Posts: 2147
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Source Records Window, Chronological Date Sorting

Post by Mark1834 » 23 Apr 2022 17:16

In layman's terms, it appears to be an internal communication error in FH - the template definition did not tell the records window that this field should be a date, so it was sorted in default alphabetical order. A lot of bugs in complex applications such as FH arise from incorrect internal communication.
Mark Draper

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

Re: Source Records Window, Chronological Date Sorting

Post by tatewise » 23 Apr 2022 18:02

Mark, that is what is so odd. The Records Window column Expression does know it is a Date and allows the Date Qualifiers.
Also, the column displays the Date using the Tools > Preferences > General tab Preferred Date Formats.
It is only the sorting process that has the 'incorrect internal communication' you describe.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply