* Data refs in diagrams

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
pwe
Famous
Posts: 232
Joined: 17 Feb 2003 21:04
Family Historian: V6.2

Data refs in diagrams

Post by pwe » 30 Mar 2021 14:41

I have added a data ref to the box tab of a diagram.
%INDI.TITL%
This works fine and I use it to add a coloured border line around relevant boxes where the individual has a title recorded using the standard fact "Title" and using the person's title eg 2nd Baronet of Lamport as a value.

I also have expressions/data refs, among others, which I use successfully.

=IsTrue(%INDI._ATTR-CIVIL_WAR_ALLEGIANCE% = "Parliament")
=IsTrue(%INDI._ATTR-CIVIL_WAR_ALLEGIANCE% = "The King")

This puts an icon, dependant on allegiance, beneath the relevant box where the custom attribute "Civil War Allegiance" has been used for that individual and the value "The King" or "Parliament" added in the fact tab of the property box.

Two things have occurred to me.
1) some data refs include the letters ATTR or EVEN [eg Civil War allegiance above] and others do not [eg Title above]. This occurs with both events and attributes.
So my query is why is this and what difference does it make please?
2) With the civil war allegiance fact I record as a value either "The King" or "Parliament" and this is used in the expression to add the correct icon. With Title I also add a value eg "2nd Baronet of Lamport" but I cannot make an expression/s to give a different mark for different titles.

=IsTrue(%INDI._ATTR-Title% = "2nd Baronet of Lamport") is not a valid expression. Why is this? It is similar to, and based on, the Civil War one.

Ideally I would like to differentiate between say Baronet and Lord or Earl and so put a different box marker for each. This would mean examining the value to find a particular word. Is this possible please?


I have scoured the Knowledge base but cannot find an answer so any help would be appreciated.
Many thanks -- Peter

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

Re: Data refs in diagrams

Post by tatewise » 30 Mar 2021 16:02

The different data ref formats depend on whether the facts are standard GEDCOM Events or Attributes, or they are Custom Events or Attributes defined by you.

%INDI.TITL% is the GEDCOM defined data ref for the standard Title Attribute.
Similarly:
%INDI.BIRT% is the GEDCOM defined data ref for the standard Birth Event.
%INDI.OCCU% is the GEDCOM defined data ref for the standard Occupation Attribute.
The codes are unique so whether they are an Attribute or an Event is part of their definition.

%INDI._ATTR-CIVIL_WAR_ALLEGIANCE% is the data ref for your Custom Civil War Allegiance Attribute.
%INDI.EVEN-KILLED_IN_ACTION% would be the data ref for a Custom Killed in Action Event.
These are not predefined so must incorporate the _ATTR or EVEN code to determine their type.

You test the 'value' of an Attribute by comparing its data ref with the value:
=IsTrue(%INDI._ATTR-CIVIL_WAR_ALLEGIANCE% = "Parliament")
or
=IsTrue(%INDI.TITL% = "2nd Baronet of Lamport")

All the data ref codes are provided by any of the Data Reference Assistants dotted around FH.
e.g.
In the Diagram > Options > Boxes tab << Add Condition > Expression there is an << Insert Data Ref... button that provides all the codes. You will find that selecting Individual + Attributes + Title will show %INDI.TITL[1]% in the box at the top, and likewise for Civil War Allegiance will show %INDI._ATTR-CIVIL_WAR_ALLEGIANCE[1]%.

See the FHUG Knowledge Base Understanding Data References for more information.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
pwe
Famous
Posts: 232
Joined: 17 Feb 2003 21:04
Family Historian: V6.2

Re: Data refs in diagrams

Post by pwe » 30 Mar 2021 18:32

Mike,
Thanks for that explanation and the expression. I thought that I had tried that before posting but perhaps I made a typo.
I am happy using the data ref assistant (I used it to create the civil war expressions) but it was the value part that stumped me.

Is there a way to test for part of the value ie to test for Baronet rather than to test for the whole 2nd Baronet of Lamport?

thanks again -- Peter

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

Re: Data refs in diagrams

Post by tatewise » 30 Mar 2021 20:42

Yes, now you are exploring functions.

=ContainsText( %INDI.TITL%, "Baronet", STD )

See Understanding Functions that leads to the FH V6 online Help page https://www.family-historian.co.uk/help ... tions.html and the complete list of functions. The similar Help page in the FH V7 program includes all the new functions.

One thing to remember with all the data refs discussed so far is they effectively have an implied index [1], i.e. %INDI.TITL[1]% and so refer to the 1st instance of the fact. The 2nd instance would be %INDI.TITL[2]% and so on.
That becomes more important with facts that often occur more than once such as Census and Occupation.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
pwe
Famous
Posts: 232
Joined: 17 Feb 2003 21:04
Family Historian: V6.2

Re: Data refs in diagrams

Post by pwe » 31 Mar 2021 18:04

Mike,
Thankyou for that - it worked just as I wanted. Now I can separate my Baronets from my Earls :lol:
Actually I used it to show the progression of a Baronetcy through a family. (unfortunately the Baronetcy did not end with me :o )

I have no experience with IT and so a lot of this is new to me. When I get a detail such as you have provided I keep a note of it in a text file which I add to my project folder to keep it safe.
Thanks again -- Peter

Post Reply