*Tutorial on Queries

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
E Wilcock
Megastar
Posts: 831
Joined: 11 Oct 2014 07:59
Family Historian: V6.1
Location: London
Contact:

Re: Tutorial on Queries

Postby E Wilcock » 11 May 2019 08:55

Mike, I have been using your Fact queries a lot.
Maybe even when I dont need to and a person query would work.
The names at the moment come sorted by forename. The column is
=GetRecord(%FACT%)

Is there any way of editing this so I can sort by surname? If necessary adding the forename in another column?
I am sorry if I have asked this before. Searching suggests that I have not.

It is not a major problem. But when working down a long list of people to see who is there, on line databases tend to order by surname.

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

Re: Tutorial on Queries

Postby tatewise » 11 May 2019 09:28

See Knowledge Base > Understanding Expressions > Examples > Fact & Name Fields towards end where it offers two expressions that "List in Surname order with Surname first/last"

Note that for Family records that will list the name of the Husband and his Wife is not listed.
To get the wives, replace MALES_FIRST by FEMALES_FIRST in either expression.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

E Wilcock
Megastar
Posts: 831
Joined: 11 Oct 2014 07:59
Family Historian: V6.1
Location: London
Contact:

Re: Tutorial on Queries

Postby E Wilcock » 11 May 2019 16:44

Mike, to be honest, I did not understand that. About Males etc. and my attempts were rejected.

But I found another link which has fixed it
=Field(FactOwner(%FACT%,1,MALES_FIRST),'INDI.NAME:SURNAME_FIRST')

This appears to produce both males and females?
And at the same time that added column sorts the Record owner column alongside, regardless of gender.

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

Re: Tutorial on Queries

Postby tatewise » 11 May 2019 17:03

That expression is exactly what my link provides.
Yes, it lists both males and females when the Fact owner is an Individual record.

BUT if the Fact is such as Marriage then the owner is a Family record and only the husband is listed.
To list the wife needs =Field(FactOwner(%FACT%,1,FEMALES_FIRST),'INDI.NAME:SURNAME_FIRST')

Remember that when you sort on ANY column it actually sorts the whole ROW, the same as sorting in a spreadsheet.
So yes ALL the columns will move in synch with the sorted column.

Think about it. If sorting one column only sorted that column and left all the others alone, that would be a real mess!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

E Wilcock
Megastar
Posts: 831
Joined: 11 Oct 2014 07:59
Family Historian: V6.1
Location: London
Contact:

Re: Tutorial on Queries

Postby E Wilcock » 12 May 2019 17:11

Yes of course. Thank you for explaining about the gender thing. I am a bit slow.
And of course too about the sorting. Just that I had not expected so have a sorted, clickable list of names along side the one which is not clickable. A welcome by-product.

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

Re: Tutorial on Queries

Postby tatewise » 12 May 2019 17:59

Not sure what you mean by "along side the one which is not clickable".
It is clickable and sortable, but simply that it sorts by Forename.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

E Wilcock
Megastar
Posts: 831
Joined: 11 Oct 2014 07:59
Family Historian: V6.1
Location: London
Contact:

Re: Tutorial on Queries

Postby E Wilcock » 13 May 2019 09:40

As always, Mike is correct. My choice of words not sufficiently precise. But from user point of view, one finds that the clickable list is now (indirectly) sorted by surname.

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

Re: Tutorial on Queries

Postby tatewise » 13 May 2019 10:20

I think your wording is still a little misleading.
In any Query (and other lists) ALL the column headers are clickable to sort the rows into that column order.
So if you click on new Owner column we've been discussing the rows sort into Surname order.
Click on original Record Owner column and the rows sort into Forename order, or more strictly cell text alphanumeric order.
Click on the Rec Id column and the rows sort into Record Id order.
Click on the Label column nnd the rows are sorted into Fact Label alphabetical order.
Click on the Date column and the rows are sorted into date order.
etc, etc...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry


Return to “General Usage”

Who is online

Users browsing this forum: ColeValleyGirl and 9 guests