How To Recurse through Genealogy Tree

JWong

New member
Joined
Sep 20, 2009
Messages
1
Programming Experience
3-5
Hi Friends:

I have a table with a genealogical data (in the form of a DataTable, sample below).

What I'd like to do is to create a tree structure based on the Key parent AND the Other parent (i.e.: the spouse of the Key parent).

Ideally, the output I want should look like this:

1 (married to 2)
5 (married to 13)​
16​
17​
6​
1 (married to 4)
7​
8​

etc...

There are multiple generations so I know I'd need recursive routine. However, the best I could do was:
1
5​
16​
17​
6​
7​
8​
etc.. (And this is NOT what I want - the separation between Indiv_ID 6 and Indiv_ID 7 is missing)


I'd really appreciate your help on this. I've already spent a whole on this yesterday getting nowhere. I'd hate to waste today (Sunday!!!) as well!

Thank you in advance!

Justin

SAMPLE DATA:
Key_Parent_ID Other_Parent_ID Indiv_ID
1 2 5
1 2 6
1 4 7
1 4 8
5 13 16
5 13 17
5 13 18
5 13 19
5 13 20
6 14 21
6 14 22
6 15 23
6 15 24
6 15 25
6 15 26
48 7 27
48 7 28
48 7 29
48 7 30
49 8 31
49 8 32
49 8 33
9 34 35
9 34 36
37 11 38
37 11 39
37 11 40
37 11 41
37 11 42
37 11 43
44 12 45
44 12 46
44 12 47
 

Latest posts

Back
Top