* Chart to show residents or events at a location

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
bbottomley
Platinum
Posts: 48
Joined: 23 Aug 2015 19:39
Family Historian: V7

Chart to show residents or events at a location

Post by bbottomley » 21 Mar 2022 12:20

I'm having a modest amount of success in developing a query (Individuals location) to produce a chart to show individuals who had events or residency associated with a particular village.
Capture2.JPG
Capture2.JPG (67.49 KiB) Viewed 784 times
However it is limited to a specific Place. I would like to extend it to show individuals in nearby villages - say within a 3 mile radius, who may have interacted with each other.

In a different query showing the results of Events Near Place which works perfectly, the function "DistanceBetween" is used. This query is a Fact type query but is not selectable when the Select/Clear Marks using Query option in the Diagram menu, probably because it is not an Individual type query.

My difficulty is that I cannot seem to get the DistanceBetween function to work in the Individuals Location query. Below are the filters used.
Capture.JPG
Capture.JPG (25.23 KiB) Viewed 784 times
Is this problem due to the fact that this query is an Individual type query and the DistanceBetween function will not work in this environment?

Many thanks as always,
Brian

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

Re: Chart to show residents or events at a location

Post by tatewise » 21 Mar 2022 12:52

=DistanceBetween(...) will work in any context if you provide the necessary parameters.
As always it helps us if you posted what you tried so we can see where the mistake lies.

Did you check the Help page DistanceBetween?
There it says it needs two Place records to compare and distance units.

Your existing filters refer to three Place records such as %INDI.BIRT.PLAC>% so they can be one parameter.

The other parameter can be a prompt as in the Fact Query or a specific Place record identified by Record Id.
e.g. Record( 345, "P" )

So suitable filters might be:
Exclude unless =DistanceBetween( %INDI.BIRT.PLAC>%, [Place: "Place"], MILES ) is less than 3
OR
Exclude unless =DistanceBetween( %INDI.DEAT.PLAC>%, Record( 34, "P" ), MILES ) is less than 3
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
bbottomley
Platinum
Posts: 48
Joined: 23 Aug 2015 19:39
Family Historian: V7

Re: Chart to show residents or events at a location

Post by bbottomley » 21 Mar 2022 16:06

Mike
I was using the same format as in the successful "Events Near" query.
Capture.JPG
Capture.JPG (37.12 KiB) Viewed 748 times
So my filters in my Individuals Location query were as follows
Capture1.JPG
Capture1.JPG (29.14 KiB) Viewed 748 times
Needless to say your suggestions work a treat.

I had looked at the help page for the function but didn't realise or wasn't sure how to nest functions.

As always, thanks for your help.
Brian

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

Re: Chart to show residents or events at a location

Post by tatewise » 21 Mar 2022 16:24

I have to admit that I don't understand why the Events Near Place query works :?
The =DistanceBetween(...) first parameter is blank and in this context, I would expect to default to %FACT% which is NOT a 'data reference to a Place record' as required, so it seems some 'magic' is converting that to a %FACT.PLAC>% data reference.
i.e. =DistanceBetween( %FACT.PLAC>%, [Place: "Place"], MILES )
I suspect that would have given you a better clue of how to adapt it for the Individual Query context.
I suspect you also overlooked ticking the Parameter option and Label: setting.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
bbottomley
Platinum
Posts: 48
Joined: 23 Aug 2015 19:39
Family Historian: V7

Re: Chart to show residents or events at a location

Post by bbottomley » 21 Mar 2022 19:43

Mike, now that you've pointed that out I'm a bit puzzled too.

Anyway thanks once again for your assistance.

Brian

Post Reply