I think I have found a bug in FH queries.
I have a query that displays the relationship between two specific individuals.
In the query, the second =RecordId() reference is producing a duplicate, unecessary, request for parameter entry.
See http://www.jamesfamily.vispa.com/recordid.html for a screenshot of the problem.
If I delete or modify - e.g. to =Name(['...']) - the =RecordId(['Ending Person']) the problem goes away.
Is this a bug, or have I missed something in my code?
Thanks
ID:2868
* Duplicate Parameter request in Query
- GladToBeGrey
- Famous
- Posts: 115
- Joined: 26 Oct 2004 09:16
- Family Historian: V7
- Location: Dorset, UK
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Duplicate Parameter request in Query
Can you upload the query, the upload image here should allow you to attach it to a forum post.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- GladToBeGrey
- Famous
- Posts: 115
- Joined: 26 Oct 2004 09:16
- Family Historian: V7
- Location: Dorset, UK
Duplicate Parameter request in Query
Hi Jon,
Yes, I'm very familiar with that article; the original questions in it were mine ... back in Nov 2002 [smile]
However, the problem was suppose to have been fixed in a much earlier version of FH. I think I may have found a new situation in which the problem occurs.
In reply to Jane, I've tried to attached the query .fhq file, but I get 'upload Failed' every time.
So here it is in plain text instead:
[Family Historian Query]
VERSION=2.0
TYPE=INDI
DESC=
This query lists the relationship between two identified individuals. Wher
e there is more than one relationship between them (for example, your cousi
n may also be your brother-in-law) the 5 closest relationship are shown. B
lood relationships are generally deemed to be closer than relationships via
marriage.
.
DESC=
.
DESC=
The generation column shows the generation of the relation, relative to the
selected individual. For example, siblings would be generation 0, parents
would be generation 1, and children would be generation -1.
.
DESC=
.
DESC=
The query also includes some hidden columns which are used to help sort the
output into a fairly logical order, based on the first instance on generat
ion (oldest first), and thereafter on distance of relationship (least close
ly related first).
.
TITLE='How =Name([''Starting Person'']) is related to =Name([''Ending Person''])'
SUBTITLE='Nearest 5 relationships'
ORIENTATION=LANDSCAPE
TAG='Starting Relation','INDI',,,78
TAG='Record Id','=RecordId()',,,38
TAG='','=LifeDates([''Starting Person''],STD)',,,31
TAG='Ending Relation','=Name([''Ending Person''])',,,78
TAG='Record Id','=RecordId([''Ending Person''])'
TAG='','=LifeDates([''Ending Person''],STD)',,,41
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,1)',,,79
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,2)',,,99
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,3)',,,50
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,4)',,,51
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,5)',,,50
TAG='Generation','=RelationCode([''Starting Person''],[''Ending Person''],GENERATION,1)',HIDDEN,DESC,42
TAG='Gens Up','=RelationCode([''Starting Person''],[''Ending Person''],GENS_UP,1)',HIDDEN,DESC,36
TAG='Gens Down','=RelationCode([''Starting Person''],[''Ending Person''],GENS_DOWN,1)',HIDDEN,DESC,45
FILTER=REL,EXC,UNLESS,Y,'Starting Person',ANC,ORG,
FILTER=REL,EXC,UNLESS,Y,'Starting Person',DESC,ORG,SP
Yes, I'm very familiar with that article; the original questions in it were mine ... back in Nov 2002 [smile]
However, the problem was suppose to have been fixed in a much earlier version of FH. I think I may have found a new situation in which the problem occurs.
In reply to Jane, I've tried to attached the query .fhq file, but I get 'upload Failed' every time.
So here it is in plain text instead:
[Family Historian Query]
VERSION=2.0
TYPE=INDI
DESC=
This query lists the relationship between two identified individuals. Wher
e there is more than one relationship between them (for example, your cousi
n may also be your brother-in-law) the 5 closest relationship are shown. B
lood relationships are generally deemed to be closer than relationships via
marriage.
.
DESC=
.
DESC=
The generation column shows the generation of the relation, relative to the
selected individual. For example, siblings would be generation 0, parents
would be generation 1, and children would be generation -1.
.
DESC=
.
DESC=
The query also includes some hidden columns which are used to help sort the
output into a fairly logical order, based on the first instance on generat
ion (oldest first), and thereafter on distance of relationship (least close
ly related first).
.
TITLE='How =Name([''Starting Person'']) is related to =Name([''Ending Person''])'
SUBTITLE='Nearest 5 relationships'
ORIENTATION=LANDSCAPE
TAG='Starting Relation','INDI',,,78
TAG='Record Id','=RecordId()',,,38
TAG='','=LifeDates([''Starting Person''],STD)',,,31
TAG='Ending Relation','=Name([''Ending Person''])',,,78
TAG='Record Id','=RecordId([''Ending Person''])'
TAG='','=LifeDates([''Ending Person''],STD)',,,41
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,1)',,,79
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,2)',,,99
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,3)',,,50
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,4)',,,51
TAG='Relationship','=Relationship([''Starting Person''],[''Ending Person''],TEXT,5)',,,50
TAG='Generation','=RelationCode([''Starting Person''],[''Ending Person''],GENERATION,1)',HIDDEN,DESC,42
TAG='Gens Up','=RelationCode([''Starting Person''],[''Ending Person''],GENS_UP,1)',HIDDEN,DESC,36
TAG='Gens Down','=RelationCode([''Starting Person''],[''Ending Person''],GENS_DOWN,1)',HIDDEN,DESC,45
FILTER=REL,EXC,UNLESS,Y,'Starting Person',ANC,ORG,
FILTER=REL,EXC,UNLESS,Y,'Starting Person',DESC,ORG,SP
- SimonOrde
- Program Designer
- Posts: 352
- Joined: 18 Nov 2002 10:20
- Family Historian: V7
- Location: Calico Pie
Duplicate Parameter request in Query
The link provided by Jon is very helpful with this one, and goes most of the way to explaining the problem. The relevant bit is this:
>> What should happen is that if you use the same label for data of the same type (e.g. all dates, all numbers, or all text values) you should get one prompt for all of them. If you used the same label for data of, say, 3 different types, you would get 3 prompts - one for each data type.<<
The problem arises because as far as FH is concerned, where you use the ['Ending Person'] label in the RecordId() function, the data type is not the same as the contexts in which you use it elsewhere in the query. The RecordId() function expects a record. All the other functions expect Individual Records - i.e. the former is more general than the latter.
You can confirm this by selecting the value for the 2 'Ending Person' parameters. In one of them you will be asked to select an Individual record. In the other, you will be asked to first choose a record type, and then to select a record of that type.
I'm afraid I can't think of any way round this with FH as it is. But I've made a note of it and will think about how best to fix it in the future.
>> What should happen is that if you use the same label for data of the same type (e.g. all dates, all numbers, or all text values) you should get one prompt for all of them. If you used the same label for data of, say, 3 different types, you would get 3 prompts - one for each data type.<<
The problem arises because as far as FH is concerned, where you use the ['Ending Person'] label in the RecordId() function, the data type is not the same as the contexts in which you use it elsewhere in the query. The RecordId() function expects a record. All the other functions expect Individual Records - i.e. the former is more general than the latter.
You can confirm this by selecting the value for the 2 'Ending Person' parameters. In one of them you will be asked to select an Individual record. In the other, you will be asked to first choose a record type, and then to select a record of that type.
I'm afraid I can't think of any way round this with FH as it is. But I've made a note of it and will think about how best to fix it in the future.
- GladToBeGrey
- Famous
- Posts: 115
- Joined: 26 Oct 2004 09:16
- Family Historian: V7
- Location: Dorset, UK
Duplicate Parameter request in Query
Simon, thanks for the reply. At least I better understand what's going on.
However, it does seem odd to me to treat the set of all records (i.e. regardless of Record Type) as a different data type to the set of all records of a specific Record Type; the latter is just a particular subset of the former, but all of the same data type, surely ?
However, it does seem odd to me to treat the set of all records (i.e. regardless of Record Type) as a different data type to the set of all records of a specific Record Type; the latter is just a particular subset of the former, but all of the same data type, surely ?