Hi all,
Could you please help me with this?
Input | |
Parent | Child |
A | B |
B | C |
C | D |
B | E |
B | F |
F | G |
G | H |
Desired output 1 |
Org chains |
A B C D |
A B E |
A B F G H |
Desired output 2 | |||||
Person | Direct child | Indirect childs | Total | Direct child | Indirect childs |
A | 1 | 6 | 7 | B | C, D, E, F, G, H |
B | 3 | 3 | 6 | C,E,F | D,G,H |
C | 1 | 0 | 1 | D | |
D | 0 | 0 | 0 | ||
E | 0 | 0 | 0 | ||
F | 1 | 1 | 2 | G | H |
G | 1 | 0 | 1 | H | |
H | 0 | 0 | 0 |