* Custom Query -- Source Title

Homeless Posts from the old forum system
Locked
avatar
hsw

Custom Query -- Source Title

Post by hsw » 24 Jan 2011 15:07

Is it possible to create a column in a Custom Query that contains the Source Title if it exists, but otherwise it contains the Source Short Title?

ID:4962

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

Custom Query -- Source Title

Post by tatewise » 24 Jan 2011 15:21

The Column Expression that should work is:

=TextIf(IsEmpty(%SOUR.TITL%),%SOUR.ABBR%,%SOUR.TITL%)

i.e. If the Full Title is Empty, then use Short Title, else use Full Title.

The above is the Expression for a Query Type: Source.
For other Query Types replace %SOUR.TITL% and %SOUR.ABBR% as appropriate.
For Individual use %INDI.****[1].SOUR[1]>TITL% / >ABBR%.

avatar
hsw

Custom Query -- Source Title

Post by hsw » 24 Jan 2011 15:31

Thank you! Queries are my Achilles heel...

avatar
delwoodman
Famous
Posts: 125
Joined: 15 Sep 2007 10:42
Family Historian: V6.2
Location: Brighton, East Sussex, UK

Custom Query -- Source Title

Post by delwoodman » 20 Aug 2011 14:39

Tatewise:

I have been trying to adapt the =TextIf expression you posted, for use in a fact query.

I have a column expression
%FACT.SOUR[1]>TITL%
which works fine but wanted to show preferentially the short title where the relavant source has one.
I tried using:
=TextIf(IsEmpty(%FACT.SOUR.TITL%),%FACT.SOUR.ABBR%,%FACT.SOUR.TITL%)

but this give me an error message. Do you have any suggestions?

I suspect the problem lies with my inexpertise with fact queries.

I am using v. 4.1.3

Regards,
Derek

avatar
delwoodman
Famous
Posts: 125
Joined: 15 Sep 2007 10:42
Family Historian: V6.2
Location: Brighton, East Sussex, UK

Custom Query -- Source Title

Post by delwoodman » 20 Aug 2011 14:51

Apologies. I mispasted my expression.

The expression I have been trying and failing to get to work is:
=TextIf(IsEmpty(%FACT.SOUR.ABBR%),%FACT.SOUR.TITL%,%FACT.SOUR.ABBR%)

Derek

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

Custom Query -- Source Title

Post by Jane » 20 Aug 2011 18:09

If you look at the original

%FACT.SOUR[1]>TITL%

Note the > between the SOUR[1] and TITL this tells FH to move to the Source record, when you created the expression you used .

Try

=TextIf(IsEmpty(%FACT.SOUR>TITL%),%FACT.SOUR>ABBR%,%FACT.SOUR>TITL%)

avatar
delwoodman
Famous
Posts: 125
Joined: 15 Sep 2007 10:42
Family Historian: V6.2
Location: Brighton, East Sussex, UK

Custom Query -- Source Title

Post by delwoodman » 20 Aug 2011 21:08

Jane:

Many thanks.

Derek

Locked