* custom query with tree root name in every record

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
piotao
Gold
Posts: 18
Joined: 28 Aug 2018 14:09
Family Historian: V6

custom query with tree root name in every record

Post by piotao » 28 Aug 2018 14:19

Hi,
I've created a modified 'Descendants' custom query with few additional fields. All is working fine and dandy, and for a specific individual from the tree I can easily create a list of all his/her descendants, with spouses. This is superb OK.

Now, I want to include the name of specified individual (for whom is the descendants tree created), in every record, in a field called 'from'. How to do this? I know that this information will repeat in evey line, but that is desired. All data will be further exported and processed, and this 'root' field is necessary. Any hint, please?

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

Re: custom query with tree root name in every record

Post by tatewise » 28 Aug 2018 14:53

Welcome to the FHUG.

I assume you still use the prompt for Starting Person.
So set the Expression to =Individual(["Starting Person"])
or to =GetField(Individual(["Starting Person"]),"%INDI.NAME%") to explicitly show name.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
piotao
Gold
Posts: 18
Joined: 28 Aug 2018 14:09
Family Historian: V6

Re: custom query with tree root name in every record

Post by piotao » 28 Aug 2018 19:12

Hey! Thank you for the quick answer. Indeed, it works! Awesome.

However, I've changed this function to my needs, using the formula:

=ToLower(GetField(Individual(["Starting Person"]),"%INDI.NAME:FIRST%"))

Simply, only firstname in lowercase is needed. However, the full name (firstname and surname) appeared in the whole column. Hmmm, maybe I can cut the text out using first space as a delimiter? However, maybe there is some simpler method, but my idea of putting NAME:FIRST seemingly is not working. Could you be so nice and drop me some clues?

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

Re: custom query with tree root name in every record

Post by tatewise » 28 Aug 2018 20:55

Yes, the following expression will do that:
=ToLower(FieldText(Individual(["Starting Person"]),'INDI.NAME:FIRST'))

There is a series of functions Field(...) and FieldText(...) and GetField(...) and GetFieldText(...) that each have slightly different capabilities, but the more complex ones take longer to execute, so could slow down a very large Query.
It is a matter of choosing the best one for the task required.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
piotao
Gold
Posts: 18
Joined: 28 Aug 2018 14:09
Family Historian: V6

Re: custom query with tree root name in every record

Post by piotao » 28 Aug 2018 22:38

Thank you, I'll look for those functions. Right now my problem was solved, I'm very happy!

Post Reply