* query help - ';Text From'; field in source pane

Homeless Posts from the old forum system
Locked
User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 15 Aug 2011 07:13

I would like to create a query that displays the 'Where within' and the 'Text From' fields that display in the source pane when I select a particular source for an individual.

I think I've figured out that the 'Where within' field is %INDI.NAME[1].SOUR[1].PAGE%. with the column heading name 'Name Source Where Within Source'.

I can't for the life of me figure out what the field name is for the 'Text From' field.

Any help is much appreciated.

Thanks,

ID:5381

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

query help - ';Text From'; field in source pane

Post by Jane » 15 Aug 2011 08:09

%INDI.BIRT[1].SOUR[1].DATA.TEXT[1]%

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 16 Aug 2011 03:47

Hi Jane,

Thanks for the reply. OK... looks like there is a different 'Text From' field for each field (birth, death, etc.) I'll have to go through and pick them all off.

Thanks,

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

query help - ';Text From'; field in source pane

Post by Jane » 16 Aug 2011 08:15

Yes, that's correct Text from source is on the citation and not the source. It's one of the reasons I prefer the 'many' sources option. So that most text lives against the Source and not the citation.

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

query help - ';Text From'; field in source pane

Post by PeterR » 16 Aug 2011 13:33

Bill,
You might find that a Fact Query is more convenient than an Individual Query.  I've just uploaded a new Query Individual Fact Citations which may be suitable for your needs;  You can of course adjust it to get rid of columns you don't want, or to change the sort order, etc.

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 16 Aug 2011 22:38

Jane,

Thanks for your help. Yes, I agree completely. That is my whole purpose for creating the query... to help me clean up my sources and citations so that I have separate sources rather than many citations pointing to the same source.

PeterR,

Your query was a great help. I do find this much easier than using an individual query. I wanted to show only those citations that actually used either 'text from' or 'where within' so I modified the query to exclude those that didn't use these. I also removed the prompt for Individual so I could report all Individuals in one report. The resulting query gives me just what I needed.

Thank you both so much!

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 16 Aug 2011 22:56

Well... I thought it was going to be just what I needed, but I've run into a little problem.

I ran the query and it showed an Individual that had something in the Text From field.  I went to that person's record and removed the data from the Text From field.

When I reran the query, I expected to not see that person in the results, but they are still there even though the Text From field now has nothing in it.

Image

Here is the filter I'm using:

Image

I would have thought the second line in the filter would have excluded this from the query.

When I show All info for that Individual's record, it shows this for the Source:

Image

What am I doing wrong?

Thanks,

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

query help - ';Text From'; field in source pane

Post by PeterR » 16 Aug 2011 23:32

Bill,
It may be that the Text From Source field contains at least one blank/space character.  When the Query results are displayed you can highlight a field, e.g. TextFromSource, and press the Delete key.  A warning pops up, and if you click OK the relevant field is deleted (not just blanked).  The relevant Fact is then correctly excluded by your ExcludeIf... filter.

You can similarly highlight a whole column in a Query Result Set and delete the lot in one go, but only if you're certain you're doing the right thing.

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 16 Aug 2011 23:41

Hi PeterR,

I don't think the field contains any blank or space characters.  When I go to the field and do a > to select the field,  nothing is selected.  

But, in any case... the idea to delete the field is a good one anyway just to get rid of the unnecessary field.

I ran the query, went to the same individual, and then selected the 'text from' field and deleted it and then ran the query and that individual no longer showed up.  I then went to the All info tab for the individual and the 'Text from Source' field was gone.

Thanks again for all your help!

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

query help - ';Text From'; field in source pane

Post by tatewise » 17 Aug 2011 10:20

Often when deleting the contents of a field, the field tag itself still remains, which is why the Query reports it.
However, if you close and re-open Family Historian, these blank fields are usually automatically deleted.

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 17 Aug 2011 19:57

tatewise,

I did see that the tags still remained. I got rid of them by running the query and deleting the field, but I'll try closing FH and reopening it next time. Thanks for the tip.

It does seem kind of confusing though. If the tag has no data associated with it, you would think it would still be 'null'. If you check a field and exclude it if the value is 'null', I would have thought a tag with no data would be excluded. Is there some way to exclude these in a query?

Hmmm... definitely not like other programming languages I've worked with. I'll have to remember that.

Thanks again,

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

query help - ';Text From'; field in source pane

Post by PeterR » 17 Aug 2011 21:42

Bill,
I've tried an alternative filter, which seems to work:

Exclude unless...

Code: Select all

=IsSet(GetField(%FACT%,'%FACT.SOUR[' . ['Index'] . '].DATA.TEXT%'))
is true

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 17 Aug 2011 21:53

Hi PeterR,

I replaced the second line in my filter with the line you provided and set it to exclude unless true.

That didn't work for me. When I ran the query I got over 6500 records, none of which actually had anything in the TextFromSource field.

When I run the original query, I get 168 records. All but 13 of these have something in the TextFromSource field. The other 13 are records where I have deleted the value from the field, but the tag still remains.

Thanks,

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

query help - ';Text From'; field in source pane

Post by tatewise » 18 Aug 2011 10:43

This seems to work when the tag exists but contains null string:
Exclude if =Bool(%FACT.SOUR[1].DATA.TEXT[1]% = '') is true

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

query help - ';Text From'; field in source pane

Post by PeterR » 18 Aug 2011 13:06

When I run the Fact Query with these two filters:
Image
the result set definitely contains only rows where the TextFromSource is populated.

User avatar
BillH
Megastar
Posts: 2183
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

query help - ';Text From'; field in source pane

Post by BillH » 18 Aug 2011 16:20

tatewise,

Thanks, that one seems to work great.

PeterR,

You are right... it does work great. Not sure what I did last time.

Thanks to both of you for all your help!

Locked