Page 1 of 1

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

Posted: 15 Aug 2011 07:13
by BillH
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

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

Posted: 15 Aug 2011 08:09
by Jane
%INDI.BIRT[1].SOUR[1].DATA.TEXT[1]%

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

Posted: 16 Aug 2011 03:47
by BillH
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,

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

Posted: 16 Aug 2011 08:15
by Jane
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.

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

Posted: 16 Aug 2011 13:33
by PeterR
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.

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

Posted: 16 Aug 2011 22:38
by BillH
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!

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

Posted: 16 Aug 2011 22:56
by BillH
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,

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

Posted: 16 Aug 2011 23:32
by PeterR
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.

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

Posted: 16 Aug 2011 23:41
by BillH
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!

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

Posted: 17 Aug 2011 10:20
by tatewise
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.

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

Posted: 17 Aug 2011 19:57
by BillH
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,

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

Posted: 17 Aug 2011 21:42
by PeterR
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

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

Posted: 17 Aug 2011 21:53
by BillH
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,

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

Posted: 18 Aug 2011 10:43
by tatewise
This seems to work when the tag exists but contains null string:
Exclude if =Bool(%FACT.SOUR[1].DATA.TEXT[1]% = '') is true

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

Posted: 18 Aug 2011 13:06
by PeterR
When I run the Fact Query with these two filters:
Image
the result set definitely contains only rows where the TextFromSource is populated.

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

Posted: 18 Aug 2011 16:20
by BillH
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!