* CombineText in a query

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
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

CombineText in a query

Post by jimlad68 » 02 Mar 2022 20:56

I am using a slightly amended column item from one of Jane's FACT queries:

Code: Select all

=Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I")
This works fine and displays the simple Individual Name in the column.

I have also worked this out to get the LifeDates:

Code: Select all

=LifeDates(Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I"),STD)
I have tried to use the CombineText, but all I get is blank.

Code: Select all

=CombineText(Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I"),LifeDates(Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I"),STD),,)
The help suggests "This function is typically used in diagram text schemes", but if I enter a simple =CombineText("a","b",,) that works fine.

Is this possible?
Is it possible to get the Name+ LifeDates without the combine?
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

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

Re: CombineText in a query

Post by tatewise » 02 Mar 2022 22:01

That is strange, as I copy & pasted your =CombineText(...) expression and it works fine.

The only snag is that there is no space between the name and life dates.

To insert a space use:

Code: Select all

=CombineText(Text(Text(Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I")) . " "),LifeDates(Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I"),STD),,)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: CombineText in a query

Post by jimlad68 » 02 Mar 2022 22:09

Apologies, it works now!! Quite proud of myself.
The space or similar will be useful, thanks.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

User avatar
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: CombineText in a query

Post by jimlad68 » 02 Mar 2022 22:12

I was just wondering how long an expression could be, I suspect from the commas the combinetext has max of 4 combines.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

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

Re: CombineText in a query

Post by tatewise » 03 Mar 2022 00:12

Over the years, many text length limits have been removed and replaced with unlimited variable-length (I think) text.
I cannot remember for certain whether that includes Query Expressions, but I think so.

The number of commas has nothing to do with how many CombineText functions can be combined.
See the FH Help page CombineText that explains the purpose of the 4 Parameters separated by the commas.
Essentially: =CombineText( <prefix>, <primary>, <suffix>, <alternative> )
Each of those parameters can themselves be any functions including CombineText(...) so you get another set of commas and so they can nested indefinitely.

BTW: FH V7 introduced the =CombineText_AB(...) function that solves the separator space problem more neatly.
e.g.
=CombineText_AB( Record(...), LifeDates(...), "1## #" )
where
Record(...) is Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I")
LifeDates(...) is LifeDates(Record(TextToNumber(GetLabelledText(%FACT.NOTE2%,"Connecting Ancestor FH Id:")),"I"),STD)
"1## #" defines the space separator between them but only if both exist.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: CombineText in a query

Post by jimlad68 » 03 Mar 2022 00:29

Thanks for the explanation, time for experiments.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

Post Reply