Page 1 of 1
function for marriage count?
Posted: 23 Nov 2015 16:45
by Rafal
Hello,
It's been over five years since I have looked at Family Historian -- it was v. 4 then and I tried to make the pedigree charts look the way I want. I was almost successful:
http://www.fhug.org.uk/forum/viewtopic. ... 64&p=41518
What I needed then was a function to return number of marriages for a person -- an equivalent of ChildCount().
I wonder if anything like that has been added with versions 5 or 6?
Best regards,
Rafal
Re: function for marriage count?
Posted: 23 Nov 2015 18:09
by tatewise
Hi Rafal, please use the User Control Panel > Profile at very top of this page to set your Family Historian Version so it shows on the right of your postings instead of None.
I don't think FH V5 or V6 have added anything to produce a Marriage Count.
Please clarify whether you actually need a Marriage count or a Family partnership count?
One counts Marriage Event (MARR) tags the other counts Family as Spouse (FAMS) tags.
In either case you could use =NumberIf() with =Exists() functions.
e.g.
For Family as Spouse case:
=NumberIf( Exists(%INDI.FAMS[3]%), 3, NumberIf( Exists(%INDI.FAMS[2]%), 2, NumberIf( Exists(%INDI.FAMS[1]%), 1, 0 ) ) )
The Marriage Event case is much more complex.
Re: function for marriage count?
Posted: 22 Nov 2016 22:55
by philmcleod
I wish to find all the individuals that have had more than 1 partner. As I am not an expert query writer is there anything readily available as an add on or guidance on columns, rows & functions to use
Thanks
Re: function for marriage count?
Posted: 22 Nov 2016 23:18
by LornaCraig
I can't remember where I got it from but I had this custom Query:
Re: function for marriage count?
Posted: 23 Nov 2016 00:57
by DavidNewton
Mikes suggestion, which records up to three spouse families, will include single person spouse families. That is, spouse familes with an unknown (to your file) partner. If you want to only count those families (i.e. amongst the first three) with a known partner then the following variation should do
=calc(NumberIf(Exists(%INDI.~SPOU[1]>%),1,0) + NumberIf(Exists(%INDI.~SPOU[2]>%),1,0) + NumberIf(Exists(%INDI.~SPOU[3]>%), 1, 0 ))
To use this in the individual records window right create a custom 'other' column labelled whatever you like and copy-paste the formula into the Expression box.
David
Re: function for marriage count?
Posted: 23 Nov 2016 08:25
by philmcleod
Thanks, but whilst David's expression works OK, for some reason Mike's returns an error that it is not a valid function or parameters entered wrongly.
I am missing something or might there be a small typo in Mikes expression.
Thanks - Phil
Re: function for marriage count?
Posted: 23 Nov 2016 09:04
by DavidNewton
There are some missing (closing) % signs in Mike's expression
=NumberIf( Exists(%INDI.FAMS[3]%), 3, NumberIf( Exists(%INDI.FAMS[2]%), 2, NumberIf( Exists(%INDI.FAMS[1]%), 1, 0 ) ) )
David
[EDIT by Mike Tate: Yes, sorry, I have corrected them in original posting.]
Re: function for marriage count?
Posted: 23 Nov 2016 09:35
by philmcleod
Thanks David - works fine now