* Multiple events / Listing all in Query mode

Homeless Posts from the old forum system
Locked
avatar
M731S25
Silver
Posts: 9
Joined: 06 Sep 2011 19:03
Family Historian: None

Multiple events / Listing all in Query mode

Post by M731S25 » 24 Sep 2011 16:10

I apologise if this has been covered elsewhere.

I have created a custom event called 'Witness' as an individual attribute.

The following report type has been created :-

Individual - %INDI%
Witness Date - %INDI.EVEN-WITNESS[1].DATE%
Witness Place - %INDI.EVEN-WITNESS[1].PLAC%
Witness Note - %INDI.EVEN-WITNESS[1].NOTE2[1]%

Exclude if
%INDI.EVEN-WITNESS[1]%
is null

As a example, I have an individual who has three witness events but the report will only list the very first event and the remaining two are ignored / skipped by FH program.

I presume that it may be something to do with the number immediately after the field - i.e. WITNESS[1] becomes WITNESS[2] and so on. If this is the case, I was hoping that the program is fully automatic.

Would someone please advise how I should structure my query in order to identify all the occurences in ANY individual's property/fact window.

Many thanks.

ID:5476

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

Multiple events / Listing all in Query mode

Post by tatewise » 24 Sep 2011 19:13

Your Query is very near the solution.

The Knowledge Base has some advice on Creating a Query at:
http://www.fhug.org.uk/wiki/doku.php?id ... ng_a_query

(1) Individual Query
The Rows tab Exclude if %INDI.EVEN-WITNESS[1]% is null is finding all the relevant Individuals.

The Columns tab needs to include entries for all the other attribute instances:
Witness Date 2  - %INDI.EVEN-WITNESS[2].DATE%
Witness Place 2 - %INDI.EVEN-WITNESS[2].PLAC%
Witness Note 2  - %INDI.EVEN-WITNESS[2].NOTE2[1]%

and similarly for [3], [4] et seq.

(2) Fact Query
Alternatively, if you are using FH V4, you could use a Fact Query as follows.

On the General tab select Query Type: Fact.

On the Columns tab create columns for:
Owner  -  =GetRecord(%FACT%)
Fact   -  %FACT%
Date   -  %FACT.DATE%
Place  -  %FACT.PLAC%
Note   -  %FACT.NOTE2%

On the Rows tab the filter would be:
Add if =FactName(%FACT%) matches 'Witness'.

Where Witness is the Name of your Custom Attribute, not its Label or Abbreviation.

avatar
M731S25
Silver
Posts: 9
Joined: 06 Sep 2011 19:03
Family Historian: None

Multiple events / Listing all in Query mode

Post by M731S25 » 24 Sep 2011 19:51

Thank you for your advice - this is much appreciated.

If I understand you correctly, the first option will generate additional columns in the report to match the amount of times I would need to add new columns.  Which is something I would want to avoid.

I am hoping the fact based query will generate 4 columns in total (in line with your suggestion) but my individual will be listed on more than one row to match every occasion they were identified as a witness.  This method sounds as though it is more user friendly.

I shall now try it and see how it performs.

Thank you again for your support.

Best Regards.

avatar
M731S25
Silver
Posts: 9
Joined: 06 Sep 2011 19:03
Family Historian: None

Multiple events / Listing all in Query mode

Post by M731S25 » 24 Sep 2011 20:37

Hi tatewise,

Sorry to be a pain.

I tried to create the fact based query.
The instructions for the column data was ok.

I went to the Row instructions and added :

Condition : 'Add if'

Expression : '=factname(%fact%)' - The Operator and Value settings stayed greyed out.

I tried replacing this string with 'FactName(%FACT%)' and nothing. Then tried the Descriptor name 'FACT.TYPE'.

This made the operator button active - so I changed it to 'matches'

Then I added 'WITNESS' in the Value bar. Clicked the add button and pressed the results button '>'. Nothing was output.

By deleting the filter from the Row tab the result of the finished report is as follows :-
Owner
Fact
Fact Date
Place
and Note record.

This is generally fine - it lists ALL the fact events - but I would like to fine tune it just for the Witness (Individual attribute) that I set up.

Would you please advise further by confirming what I will need to enter in each of the filter setting fields (ie. Condition, Expression, Operator and Value)

Best Regards.

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

Multiple events / Listing all in Query mode

Post by tatewise » 24 Sep 2011 20:56


Condition:  Add if
Expression: =FactName(%FACT%)
Operator:   matches
Value:      Witness

If I point out your data entry errors it may help in future:
In the Expression: =factname(%fact%) the tag %FACT% must be in upper case.
The replacement FactName(%FACT%) omitted the leading = sign.
The case of the Function name factname or FactName is not important.

avatar
M731S25
Silver
Posts: 9
Joined: 06 Sep 2011 19:03
Family Historian: None

Multiple events / Listing all in Query mode

Post by M731S25 » 24 Sep 2011 21:09

Hi tatewise,

Absolutely magic.

Thanks again for your support.

Best Regards.

Locked