I have some cases where individuals' events (birth/death etc) cite multiple sources.
What I am trying to do is write a query that will find me individuals (or facts) that have *any* source which matches my criteria (i.e. for birth events where source.type='Birth Index' and source.repository.name='FreeBMD').
In my fact query, I end up with columns using expressions something like this:
=IsTrue(%FACT.SOUR>_TYPE% = "Baptism Index") which as far as I can tell from the help file is equivalent to:
=IsTrue(%FACT.SOUR[1]>_TYPE% = "Baptism Index")
But this only matches the first source associated with a fact - I want to check whether any source associated with a fact matches the criteria.
Do I need to make assumptions about the max number of source citations per fact (3 in this example) and write a query expression like:
=IsTrue(%FACT.SOUR[1]>_TYPE% = "Baptism Index" or %FACT.SOUR[2]>_TYPE% = "Baptism Index" or %FACT.SOUR[3]>_TYPE% = "Baptism Index" ) ?
As an aside is there any way to get the counts of related records such as the number of source citations per fact/event?
* Query to determine if any matching source citation exists.
-
dukeofdarkness
- Newbie
- Posts: 1
- Joined: 01 Oct 2015 17:41
- Family Historian: V6
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Query to determine if any matching source citation exist
Welcome to the FHUG.
As a newcomer may I suggest how_to:key_features_for_newcomers|> Key Features for Newcomers.
Regarding the number of source citations per fact/event, the thread Property Box - showing sources (12275) discusses a related topic and offers some solutions, but it is not straightforward.
Essentially you have got it correct about the max number of source citations per fact, and that you must use an [index] for each possible instance.
However, it poses some other points to ponder...
Usually users ensure that the most relevant Source is instance [1] so in practice you should not need to test any others, because if a Source matches your important criteria then surely it will be the first. Think about it!
If say a Baptism Source provides both Baptism and Birth details, then you may have Birth events with a Source Type equal to "Baptism Index", which matches your criteria Column Expression. Similarly, as well as Census events, there may be Birth or Occupation events with Source Type equal to "Census". Is this what you want? If not, then the =FactLabel() must be incorporated into the Column Expression.
It is possible that your criteria become too complex for a Query and a Plugin will be a better solution.
As a newcomer may I suggest how_to:key_features_for_newcomers|> Key Features for Newcomers.
Regarding the number of source citations per fact/event, the thread Property Box - showing sources (12275) discusses a related topic and offers some solutions, but it is not straightforward.
Essentially you have got it correct about the max number of source citations per fact, and that you must use an [index] for each possible instance.
However, it poses some other points to ponder...
Usually users ensure that the most relevant Source is instance [1] so in practice you should not need to test any others, because if a Source matches your important criteria then surely it will be the first. Think about it!
If say a Baptism Source provides both Baptism and Birth details, then you may have Birth events with a Source Type equal to "Baptism Index", which matches your criteria Column Expression. Similarly, as well as Census events, there may be Birth or Occupation events with Source Type equal to "Census". Is this what you want? If not, then the =FactLabel() must be incorporated into the Column Expression.
It is possible that your criteria become too complex for a Query and a Plugin will be a better solution.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Query to determine if any matching source citation exist
This thread may be "partially" helpful, (my apologies for my multiple posts). With attached plugins and queries.
Source - Where Used (12770)
you should be able to use plugin List all citations for ALL sources, sort on data text then data link then record, then find your person and event. It might be helpful if there were an individual record id column to differentiate between individuals, but the sort above should "mostly" put them in order.
But, not very "instant"
Source - Where Used (12770)
you should be able to use plugin List all citations for ALL sources, sort on data text then data link then record, then find your person and event. It might be helpful if there were an individual record id column to differentiate between individuals, but the sort above should "mostly" put them in order.
But, not very "instant"
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68