* Custom Events fields

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
avatar
Darryl-W
Gold
Posts: 15
Joined: 19 Jun 2018 23:45
Family Historian: V7

Custom Events fields

Post by Darryl-W » 26 Apr 2020 03:59

Hello,
I created a custom EVENT to display the Interment of individuals.
I need to have the Interment DATE and the Interment NUMBER .
My custom events shows the number but it is NOT a number I thinks it is sorting as TEXT .
I cant see a way to force the event NUMBER as a Number .
My sort on the number field reveals in sequence 1002799 , 1003, 1003629 , 10057 how can I make it NUMERIC and sort low to high
Thank you for considering my dilemma

Darryl

User avatar
Valkrider
Megastar
Posts: 1534
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Custom Events fields

Post by Valkrider » 26 Apr 2020 06:16

The typical way to do this in any computer programme is to pad the number with leading or trailing zero's (whichever is appropriate in the individual case) so they are all the same length. They will then sort properly.

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Custom Events fields

Post by Jane » 26 Apr 2020 08:16

Did you mean an Event or an Attribute?

Are you sorting them in a Query? If so have you tried wrapping the data reference with the =number() function?
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

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

Re: Custom Events fields

Post by tatewise » 26 Apr 2020 10:20

Unfortunately the =Number(...) function does not produce a text display in a Query column.
However, the =TextToNumber(...) function works perfectly.

So if the Interment Number is the Value of your custom Interment Attribute the Expression would be:
=TextToNumber(FactValue(%FACT%)) in the Columns tab of a Fact Query.

However, if other Attribute facts have non-numeric Values, then they will not display correctly.
So what seems to work is two Columns :-
=TextToNumber(FactValue(%FACT%)) Sort: Ascending Type: Hidden
=FactValue(%FACT%) Sort: Ascending Type: Normal
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply