* Help needed to write an expression
Help needed to write an expression
After a year or so of using Family Historian I've finally ventured into the realms of queries and icons - scary as I've never written a query which worked and usually go out of my way to avoid them. I've managed to create a few named lists by adjusting standard queries but now I'm stuck. I have two slightly different situations.
I want to put an icon in a diagram to make it obvious when there is no issue, primarily when the person died as a child, but I can't write an expression which works. Given the time period, I need something along the lines of burial date is less than fifteen years after baptism date. Could somebody tell me what I need to write please? Presumably it would then be simple to change this to birth/death dates for later data.
I would also like to be able to create a named list for all individuals of a given surname who do not have issue at the end of their life by using a query. Again, I don't have a clue how to do it. All help gratefully received!
Many thanks,
Pauline
I want to put an icon in a diagram to make it obvious when there is no issue, primarily when the person died as a child, but I can't write an expression which works. Given the time period, I need something along the lines of burial date is less than fifteen years after baptism date. Could somebody tell me what I need to write please? Presumably it would then be simple to change this to birth/death dates for later data.
I would also like to be able to create a named list for all individuals of a given surname who do not have issue at the end of their life by using a query. Again, I don't have a clue how to do it. All help gratefully received!
Many thanks,
Pauline
- davidm_uk
- Megastar
- Posts: 740
- Joined: 20 Mar 2004 12:33
- Family Historian: V7
- Location: St Albans, Hertfordshire, UK
Re: Help needed to write an expression
For the first of your needs there's an alternative. If you set the individuals "child count" to 0 then in diagrams a solid line will be drawn under their box.
To set child count to 0, open the individuals Property Box, select the All tab, right click on their name (the one in CAPITALS at the top of the tree), select Attribute and click Child Count. In the box that appears just enter 0.
I don't know if you can achieve the above with an expression, Someone will no doubt be able to advise.
Once you have child count as zero I'm sure that a query can be made to list those people, then you can add them to named list.
PS - you can also add a column into the Individual Records Window to display child count, and then sort on it to bring all of the 0 entries together.
To set child count to 0, open the individuals Property Box, select the All tab, right click on their name (the one in CAPITALS at the top of the tree), select Attribute and click Child Count. In the box that appears just enter 0.
I don't know if you can achieve the above with an expression, Someone will no doubt be able to advise.
Once you have child count as zero I'm sure that a query can be made to list those people, then you can add them to named list.
PS - you can also add a column into the Individual Records Window to display child count, and then sort on it to bring all of the 0 entries together.
David Miller - researching Miller, Hare, Walker, Bright (mostly Herts, Beds, Dorset and London)
Re: Help needed to write an expression
Thanks. I didn't know about the child count. The only issue I've got with that is that I've got to do it for each person - and there's an awful lot of them!
Pauline
Pauline
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help needed to write an expression
The way to do it with an Expression is to use the Diagram > Options > Boxes tab and <<Add Condition > Expression.
So let's look at some potential Expressions.
=IsTrue( AgeAt( %INDI%, %INDI.BURI.DATE% ) < 15)
This relies on both a specified Birth Event Date and a specified Burial Event Date.
=IsTrue( EstimatedAgeAt( %INDI%, %INDI.BURI.DATE%, AVG, 2 ) < 15 )
This works for a Birth or Baptism or Christening event Date or uses a date estimated from relatives dates.
=IsTrue( EstimatedAgeAt( %INDI%, EstimatedDeathDate( %INDI%, MID, 2 ), AVG, 2 ) < 15)
This works as above, but works for a Death or Burial or Cremation event Date or uses a date estimated from relatives dates.
BUT the above only identify deceased children under 15 who are assumed to have no issue.
I suspect you really want to identify everybody who had no issue such as follows.
=IsTrue( Not( Exists( %INDI.~CHIL>% ) or NullDate( EstimatedDeathDate( %INDI%, MID, 2 ) ) ) )
Exists( %INDI.~CHIL>% ) determines if any child exists from any relationship.
NullDate( EstimatedDeathDate( %INDI%, MID, 2 ) ) checks that no death date exists.
If those are both not true, then the person has no issue and has died.
See how_to:using_flags_and_icons_and_expressions|> Using Flags and Icons and Expressions for further advice.
So let's look at some potential Expressions.
=IsTrue( AgeAt( %INDI%, %INDI.BURI.DATE% ) < 15)
This relies on both a specified Birth Event Date and a specified Burial Event Date.
=IsTrue( EstimatedAgeAt( %INDI%, %INDI.BURI.DATE%, AVG, 2 ) < 15 )
This works for a Birth or Baptism or Christening event Date or uses a date estimated from relatives dates.
=IsTrue( EstimatedAgeAt( %INDI%, EstimatedDeathDate( %INDI%, MID, 2 ), AVG, 2 ) < 15)
This works as above, but works for a Death or Burial or Cremation event Date or uses a date estimated from relatives dates.
BUT the above only identify deceased children under 15 who are assumed to have no issue.
I suspect you really want to identify everybody who had no issue such as follows.
=IsTrue( Not( Exists( %INDI.~CHIL>% ) or NullDate( EstimatedDeathDate( %INDI%, MID, 2 ) ) ) )
Exists( %INDI.~CHIL>% ) determines if any child exists from any relationship.
NullDate( EstimatedDeathDate( %INDI%, MID, 2 ) ) checks that no death date exists.
If those are both not true, then the person has no issue and has died.
See how_to:using_flags_and_icons_and_expressions|> Using Flags and Icons and Expressions for further advice.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Help needed to write an expression
Thanks Mike, that's what I needed. The sheer quantity of brackets alone is enough to defeat me, never mind the GEDCOM. I've run one on the diagram and got the results I needed and the rest are printed off and in my file of 'how to do it' - just in case I lose the post. I've been intimidated by the power of the programme up until now but really ought to get to grips with it. Do you run courses on how to use these features for people with no idea? I could really use one 
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help needed to write an expression
Pauline, there are courses in London, see http://www.family-historian.co.uk/community/events.
Jane runs courses annually in Somerset, see Family Historian courses in Somerset (14906).
Local History Societies have also run courses, but it is largely a matter of practice & experimentation, plus motivation.
There are many tutorials and much advice in how_to:key_features_for_newcomers|> Key Features for Newcomers and elsewhere in our [kb]|[/kb] such as how_to:using_flags_and_icons_and_expressions|> Using Flags and Icons and Expressions.
There are several ways to get back to particular postings.
If you only have a few, then use Quick Links > Your posts top right.
Alternatively, display the thread, scroll to bottom of page, and use the spanner Topic tools > Bookmark topic.
Thereafter, click your username top right, and choose View Bookmarks.
Jane runs courses annually in Somerset, see Family Historian courses in Somerset (14906).
Local History Societies have also run courses, but it is largely a matter of practice & experimentation, plus motivation.
There are many tutorials and much advice in how_to:key_features_for_newcomers|> Key Features for Newcomers and elsewhere in our [kb]|[/kb] such as how_to:using_flags_and_icons_and_expressions|> Using Flags and Icons and Expressions.
There are several ways to get back to particular postings.
If you only have a few, then use Quick Links > Your posts top right.
Alternatively, display the thread, scroll to bottom of page, and use the spanner Topic tools > Bookmark topic.
Thereafter, click your username top right, and choose View Bookmarks.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- LornaCraig
- Megastar
- Posts: 2996
- Joined: 11 Jan 2005 17:36
- Family Historian: V7
- Location: Oxfordshire, UK
Re: Help needed to write an expression
I wonder if Pauline wants to identify individuals who are known to have had no children, or for whom it is very unlikely. That is very different from identifying individuals for whom no child has been recorded in the Gedcom file. A glance at the diagram itself shows whether someone has any children recorded (assuming the diagram options are set to show enough generations).tatewise wrote: BUT the above only identify deceased children under 15 who are assumed to have no issue.
I suspect you really want to identify everybody who had no issue such as follows.
=IsTrue( Not( Exists( %INDI.~CHIL>% ) or NullDate( EstimatedDeathDate( %INDI%, MID, 2 ) ) ) )
Exists( %INDI.~CHIL>% ) determines if any child exists from any relationship.
NullDate( EstimatedDeathDate( %INDI%, MID, 2 ) ) checks that no death date exists.
If those are both not true, then the person has no issue and has died.
Lorna
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help needed to write an expression
Pauline said she wanted "to put an icon in a diagram to make it obvious when there is no issue, primarily when the person died as a child", so I offered several alternatives, but she doesn't say which one she chose.
I imagine the only definitive way to identify no issue would be to use the Child Count facts, but Pauline baulked at that, and wanted an Expression solution.
I imagine the only definitive way to identify no issue would be to use the Child Count facts, but Pauline baulked at that, and wanted an Expression solution.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Help needed to write an expression
Many thanks for the help. I'll be using those expressions more than once and in different ways. At the moment I'm working on a reconstruction of the Penaluna family in Constantine in the 16th and 17th centuries using the remains of the early parish records, poll tax, wills etc. with far too many people called Richard and John. The icons enable me to see at a glance where there cannot be any family - useful in a diagram that's far wider than it's deep. Unfortunately, it's also showing up how many burial records are missing - and , of course, there's the forty-one year old bachelor who needs an icon and hasn't got one ...
I'll check out the courses. Somerset will be the more likely from down here.
Thanks again,
Pauline
I'll check out the courses. Somerset will be the more likely from down here.
Thanks again,
Pauline