* =factowner()

Homeless Posts from the old forum system
Locked
avatar
alkyl
Gold
Posts: 11
Joined: 12 Nov 2009 12:05
Family Historian: None

=factowner()

Post by alkyl » 12 Nov 2009 12:46

Is there a function available for a 'Fact' type custom query which will display the fact owner(s) with surname first (preferably in upper case) followed by given names (in normal order)?

ID:4134

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

=factowner()

Post by Jane » 12 Nov 2009 14:14

I thought you might able to use

=Field(FactOwner(%FACT%,1,MALES_FIRST),'INDI.NAME:SURNAME')

but it looks like it ignores the qualifier.

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

=factowner()

Post by PeterR » 12 Nov 2009 14:55

Yes, Jane, I've also found this problem, which also affects the =GetField() function.  I wonder if this is a bug, or an undocumented limitation - there is no syntax error.

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

=factowner()

Post by PeterR » 15 Nov 2009 13:42

The above-mentioned failure of the =Field() and =GetField() functions to recognize a valid Qualifier for the %INDI.NAME% Field occurs when the functions are used in Query Filters as well as in Column definitions. However, a workaround is possible since the following Filter works OK:

Add If =Text(Field(FactOwner(%FACT%,1,MALES_FIRST),'INDI.NAME')) ends with ['Surname'].

Note that without the use of the =Text() function as a 'wrapper', a Filter such as:
=Field(FactOwner(%FACT%,1,MALES_FIRST),'INDI.NAME:SURNAME')
prompts for type of record (for which you specify Individual) and then only allows the selection of a single matching Individual, even though the value returned and displayed in a Column is already a text Field rather than a Record.

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

=factowner()

Post by Jane » 15 Nov 2009 19:06

I did query this with Calico and understand that the GetField returns a field and not a text / number entry so qualifiers are not allowed (it should error if they are used, but does not, I got the impression functions might be added to a future release to provide support for Qualifiers on Fields.

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

=factowner()

Post by PeterR » 20 Mar 2010 14:36

A new function in v4.1.0 solves the original problem. Either of the following expressions will produce Surname in a Fact query:

Code: Select all

=FieldText(GetRecord(%FACT%),'INDI.NAME:SURNAME')

=FieldText(FactOwner(%FACT%,1,MALES_FIRST),'INDI.NAME:SURNAME')
But only the second example works for Family facts, e.g. Marriage.

Locked