* Functions in value fields in queries

Older V4 Queries please post for any version in the General Forum
Locked
avatar
baw
Gold
Posts: 20
Joined: 04 May 2012 12:14
Family Historian: V6

Functions in value fields in queries

Post by baw »

I have redone all my census image data using Ancestral source method 1 after first using method 2.
I am now happy with the result except for the fact that some facts are now duplicated - specifically occupations. These show up as identical except for different sources - one has an AS type 1 source, the other a type 2.
An example:
Occupation: Scholar
Date: 5 April 1891
Source: [S12] Census 1891
Where Within Source: RG12 piece 2100 folio 100 page 3
Occupation: Scholar
Date: 5 April 1891
Source: [S192] Census 1891 RG12 piece 2100 folio 100 page 3

I want to identify which individuals are affected so I can delete the old type 2 fact.

I'm trying to create a query which looks for occupation dates
%INDI.OCCU[1].DATE% and %INDI.OCCU[2].DATE% which are equal.
(I know I'll have problems if the duplicates are 2nd and 3rd instances, but I'll live with that)
Using something like an Include if in the Rows part of a query the problem is specifying the value that I want to compare %INDI.OCCU[1].DATE% to. I've tried using
Contains text
=FieldText(%INDI.OCCU[2}%,'INDI.OCCU[2].DATE')
and variations, (e,g, was on and Field(... ) but I can't do it.

I'm using FH v4.1.3

Any ideas?

Thank you

Brian

ID:6939
avatar
baw
Gold
Posts: 20
Joined: 04 May 2012 12:14
Family Historian: V6

Functions in value fields in queries

Post by baw »

Ah, If I use the Textif function in the expression field I can do it.
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Functions in value fields in queries

Post by tatewise »

Why not simply select the Type 2 Source Record in the Sources Records Window and use View > Record Links.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
baw
Gold
Posts: 20
Joined: 04 May 2012 12:14
Family Historian: V6

Functions in value fields in queries

Post by baw »

Tatewise: because I have many more records linked to the old type 2 source than had the duplicate occupation problem. In my early days of setting up the tree I used those type 2 source types for names, estimated birth years and so on. In due course, I'll clean everything up, but with over 900 individuals it's going to take time, so I'm doing it bit by bit.....

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

Functions in value fields in queries

Post by Jane »

If as some point you move to V5, the List Citations for Source Plugin should help allowing you to delete the items you want to get rid of on a single screen.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Functions in value fields in queries

Post by tatewise »

Returning to your original question, the following will work:
Condition: Add if
Expression: =IsTrue(%INDI.OCCU[1].DATE% = %INDI.OCCU[2].DATE%)
Operator: is true

and
Expression: =IsTrue(%INDI.OCCU[2].DATE% = %INDI.OCCU[3].DATE%)

will find further instances.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
baw
Gold
Posts: 20
Joined: 04 May 2012 12:14
Family Historian: V6

Functions in value fields in queries

Post by baw »

A neater solution than mine, thank you

Brian
Locked