Page 1 of 1
Family Query Showing Father amp; Mother ID
Posted: 08 Jan 2005 13:08
by rossm
Is it possible to create a Family Query with columns for the FamilyID [=RecordId(%FAM%)], Husband's Name and ID, and Wife's name and ID? I have no problem with the FamilyID, but I have thus far failed to find a way of querying the IDs of Husband and Wife. Is it not possible to combine within a single query functions for both Family and Individual IDs?
I realise that this is a rather 'odd' Query. Its need arises from my having to manually edit (TextPad) and 'deconsolidate' two large and complex GEDCOMs to faciliate their merge into my master data file - trying to merge them in their current state has proved too messy. The output of my target Query will help me check that I haven't overlooked or mismatched any records
Ross
ID:726
Family Query Showing Father amp; Mother ID
Posted: 08 Jan 2005 13:29
by rossm
Solved!
My problem was due to a missing '>' character in the RecordID function:
This worked: =RecordId(%FAM.HUSB>%)
This didn't: =RecordId(%FAM.HUSB%)
Is there a document explaining the use of the 'special' characters - eg '%', ':' and '>'
Ross
Family Query Showing Father amp; Mother ID
Posted: 21 Jan 2005 11:10
by Gamnel
I had a similar problem but I found that adding a column to show the Name of the individual (or in my case the family) provided the parameter name to be entered between the % characters.
For example display the query dialog and select an Individual query.
Then on the Columns tab select Father and add it to the columns.
You will get the entry 'Father INDI.~FATH>' (I'll use quotes around the text you see or type).
Select the resulting entry and goto the expresion field at the bottom of the dialog.
Expression contains 'INDI.~FATH>'. Edit the expression to put '=RecordId(%' before and '%)' after then click the update button.
Father will then be changed to show the Father's ID instead of the Father's record.
I haven't experimented with this idea fully but if the parameter is valid at least it will supply the name in the correct format.
Family Query Showing Father amp; Mother ID
Posted: 27 Jan 2005 10:28
by SimonOrde
Ross and Gamnel
this is very much an advanced topic, which ordinary users are not expected to ever need or want to know about. So for any reader who doesn't have a clue what I'm on about - don't worry. No-one needs to understand any of this stuff!
That said...
The expression between the % characters is called a 'data reference' within Family Historian. If you click on the Help contents, and expand General Topics and then Advanced Topics, you will find the topic 'Understanding Data References' which gives some information about them (including an explanation for the '>') character. In most contexts in which data references are used, they have to have % characters round them to distinguish them from the surrounding text (e.g. in text schemes within diagrams). But within a query, when you are entering the data reference into the expression field, it knows what to expect so the % characters are not required (or allowed?).
There are actually 2 kinds of expressions: data references and functions. Functions always begin with an '=' sign (as in MS Excel if you know that). Functions are also described in the Advanced Topics section ('Understanding Functions'). '=RecordId()' is a function which takes one parameter. This parameter defaults to the current record if not supplied. If you want to use a data reference to supply the parameter, it must have % characters around it, to make clear that it is a data reference that is being inserted, and it must be a data reference that is appropriate for the query type (e.g. %INDI>~FATH% will only work in an Individual Query - because the first part is INDI, which means that it presupposes you are starting with an INDIvidual record.
Also, =RecordId() expects to be given a reference to a record (any type of record). So if you use a data reference it must refer to a record. This is where the '>' comes in. The difference between say:
%INDI.FAMC%
and
%INDI.FAMC>%
is that the first refers to a field in the INDIvidual record which stores a link to the indivdual's FAMily-as-Child. The second (thanks to the '>' character) doesn't refer to the link. It refers to the record that it links to. So its the 2nd that you need.
Gamnel's suggestion of using the columns tab as a quick way to generate data references that refer to records is a good one, and should work fine (subject to the other points already made about making sure you get you are referring to the right kind of thing, etc).
Hope this helps.