* Diagram text scheme template

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
Post Reply
User avatar
LornaCraig
Megastar
Posts: 1770
Joined: 11 Jan 2005 17:36
Family Historian: V6.2
Location: Oxfordshire, UK

Diagram text scheme template

Post by LornaCraig » 19 Nov 2018 16:37

I work with diagrams a lot but instead of using icons to indicate censuses I include census details in the text scheme, to show at a glance where someone was at 10 year intervals. I use a census event for the UK 1939 Register.

My template for the census in the diagram text scheme is:
=ExistsText(%INDI.CENS[1+]%,"Census") %INDI.CENS[1+].DATE:YEAR%: %INDI.CENS[1+].ADDR%=ExistsText(%INDI.CENS[1+].ADDR%,", ")%INDI.CENS[1+].PLAC:MEDIUM%

which produces, for example:

Census 1911: 3 Tucker Street, Wells, Somerset

My template for the census sentence in the Property box is:
{individual} was recorded in the {=TextIf(GetDisplayText(%FACT.DATE%,min) = "29 September 1939","National Register","census")} {date} {place}<, at {address}>

which produces:

He was recorded in the census on 2 April 1911 in .....
or
He was recorded in the National Register on 29 September 1939 in......

substituting National Register for Census as appropriate.

I have been trying, and failing, to change the diagram text scheme line to make the same substitution in the case of the National Register. Can anyone come to my aid?

It’s a trivial point but it bugs me that I can’t work it out!
Lorna

User avatar
tatewise
Megastar
Posts: 18914
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Diagram text scheme template

Post by tatewise » 19 Nov 2018 16:59

The first function needs adapting along the same lines as the Sentence Template:

=ExistsText(%INDI.CENS[1+]%,TextIf(GetDisplayText(%INDI.CENS[1+].DATE%,min) = "29 September 1939","National Register","Census"))

Also =CombineText( ,%INDI.CENS[1+].ADDR%, ", ", ) is a bit more compact and efficient
than %INDI.CENS[1+].ADDR%=ExistsText(%INDI.CENS[1+].ADDR%,", ")
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
LornaCraig
Megastar
Posts: 1770
Joined: 11 Jan 2005 17:36
Family Historian: V6.2
Location: Oxfordshire, UK

Re: Diagram text scheme template

Post by LornaCraig » 19 Nov 2018 17:21

Thanks. I had it almost right but must have omitted a comma. It was too late last night when I was looking at it!
I'll use the more compact =CombineText option too.
Lorna

avatar
Malchal
Gold
Posts: 26
Joined: 20 Jun 2016 08:23
Family Historian: V6
Location: Shropshire

Re: Diagram text scheme template

Post by Malchal » 21 Sep 2020 06:08

Is there somewhere to learn the basics of how to write this code please.

User avatar
tatewise
Megastar
Posts: 18914
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Diagram text scheme template

Post by tatewise » 21 Sep 2020 09:00

Yes, start with Knowledge Base > Understanding Expressions.
That cross-refers to Data References and Functions that are the key components and to FH Help pages.

If you have any particular Expression in mind then we could use it as a tutorial here.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply