3 Replies Latest reply on Dec 7, 2012 10:21 AM by davidanders

# Family Contacts - show siblings, children, grandchildren

### Title

Family Contacts - show siblings, children, grandchildren

### Post

Database will be a RunTime
Win XP & OSX 10.5    FMPA 11

Contact >--< Family
Contact >--< CalEvents >--< SeedCodeCalendar

ContactTable::ParentFamilyCode (FatherLastName - MotherLastName) [Smith-Jones]eg.
ContactTO Portal shows Siblings, Father, Mother

ContactTable::FamilyCode (HusbandLastName - WifeLastName) [Black-Smith]eg.
ContactTO Portal shows Children, Husband, Wife

Show Grandchildren?     Calculation  ParentFamilyCode & "-" & FamilyCode  ???

Three Generations to be viewed - ParentFamily, Family, ChidrenFamily(s)

Hierachial Solution?  Join Table?  Confusing Number Fields?

• ###### 1. Re: Family Contacts - show siblings, children, grandchildren

Are they charging you by the word when you post?

I"ve set this up in some of my solutions with a "Family" table and a join table between Contact and Family.

The reason I did that is because a given contact might be listed as a member of more than one family.

The relationship to that family could be noted in a field in the Join table.

Thus "Janice Smith" might be linked to the "Jones" family as "Daughter" and to the "Smith" family as "Wife".

• ###### 2. Re: Family Contacts - show siblings, children, grandchildren

I have read some very wordy questions recently, left an impression

I have made Contact DBs with Simple Family Links, easy to implement - bdays and such.
Data viewed from the viewpoint of the Contact.
Contact can be sister, mother, grandmother, greatperson....
This is data viewed from the viewpoint of a FamilyMember.
Doing this for my Sister - I have 7 siblings, 27 children/niece/nephews, 14grandthings - you see where this complicates.

Family "Smith" seems to limiting - Family  "Smith-Jones" gives more specific focus.
Typing the question, lead to thinking, maybe  a Contact >--< Family >--< FamilyGroup structure.
Picking your viewpoint to look at the data is key.

• ###### 3. Re: Family Contacts - show siblings, children, grandchildren

Searching for info Family Links Grand, Parent, Child, GrandChild found  NO CLEAR ANSWERS

http://buzz.beezwax.net/2011/10/07/good-sir-williams-heirs
Portals, portal filters, children, grandchildren with scripts and examples.

http://www.briandunning.com/cf/534
Custom Function  GetValueSet_MultiLevel ( child ; parent ; startValue ; childMarker ; c
Description:
This function returns a valueset in a subsummary format.
This function requires that the data be denormalized so that the break field from the parent table resides within the child table. It is also required that the child table be sorted by the parent id or the parent data field.
It adapted from the "GetValueSet" function created by Ray Cologon of NightWing Enterprises (http://www.nightwing.com.au/FileMaker/).

/*
GetValueSet_MultiLevel ( child ; parent ; startValue ; childMarker ; childDelimiter ; parentDelimiter )
*/
Case (
GetNthRecord (parent; startValue )  = GetNthRecord (parent; startValue - 1);
childDelimiter & childMarker & GetNthRecord ( child; StartValue ) &
Case (
GetNthRecord (parent; startValue )   ≠  GetNthRecord (parent; startValue + 1);
parentDelimiter;
""
);
GetNthRecord (parent; startValue ) & childDelimiter & childMarker & GetNthRecord ( child; startValue )
)
&
If(IsValid(GetNthRecord  ( child; startValue + 1));
GetValueSet_MultiLevel ( child ; parent ; startValue +1; childMarker; childDelimiter; parentDelimiter))

I found that the parentDelimiter is only called in the result of the first argument of the base case statement. It needs to be called in *both* the first result and the default result, as part of the embedded Case statement (and then the childDelimiter removed from the beginning of the first result). I also added another argument in the embedded Case statements to skip the delimiter entirely for the last value, so as not to end with a final delimiter. Here's my modifications:
Case (
GetNthRecord (parent; startValue ) = GetNthRecord (parent; startValue - 1);
childMarker & GetNthRecord ( child; StartValue ) &
Case (
Not IsValid ( GetNthRecord ( child; startValue + 1));
"";
GetNthRecord (parent; startValue ) ≠ GetNthRecord (parent; startValue + 1);
parentDelimiter;
childDelmiter
);
GetNthRecord (parent; startValue ) & childDelimiter & childMarker & GetNthRecord ( child; startValue ) &
Case (
Not IsValid ( GetNthRecord ( child; startValue + 1));
"";
GetNthRecord (parent; startValue ) ≠ GetNthRecord (parent; startValue + 1);
parentDelimiter;
childDelmiter
)
)
&
If(IsValid(GetNthRecord ( child; startValue + 1));
GetValueSet_MultiLevel ( child ; parent ; startValue +1; childMarker; childDelimiter; parentDelimiter))

http://newsgroups.derkeiler.com/Archive/Comp/comp.databases.filemaker/2007-05/msg00156.html
Re: Managing Genealogy Relationships in FMP 8.5

http://gofm.biz/2011/09/17/property-report-challenge-ii/
The problem is not easy and probably not worth the effort.