Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I send you a very simple dataset.
PARENT | CHILD |
NG04241DE00 | PAL002 |
NG04241DE00 | BOL006 |
NG04241DE00 | INC038 |
NG04241DE00 | NG04241DI00 |
NG04241DI00 | CAJ001 |
NG04241DI00 | PA46NG000 |
As you can see, it's a 3 level tree: NG04241DE00 is root, and then all are final nodes except NG04241DI00, which has two final nodes below.
What I want is a table like this:
ANCESTOR | CHILD |
NG04241DE00 | PAL002 |
NG04241DE00 | BOL006 |
NG04241DE00 | INC038 |
NG04241DE00 | NG04241DI00 |
NG04241DE00 | CAJ001 |
NG04241DE00 | PA46NG000 |
This table shows the root and all of the nodes below, even the children of NG04241DI00.
I thought Hierarchy_Belongs_To should solve this situation, but it doesn't show the children of NG04241DI00, just:
ANCESTOR | CHILD |
NG04241DE00 | PAL002 |
NG04241DE00 | BOL006 |
NG04241DE00 | INC038 |
NG04241DE00 | NG04241DI0 |
The way I am using the function is: HierarchyBelongsTo(child_id,parent_id,child_name,'Ancestor ID','Ancestor')
Am I maybe using wrongly that function? Any ideas?
Thanks!
In my data I was missing the "parentless child" for the root!!
Thanks!
or tryng in listbox?
if yes
u can Tick Show as tree view with seperator
Works for me:
HierarchyBelongsTo(CHILD,PARENT, CHILDNAME, 'AncestorID','AncestorName', Depth)
LOAD PARENT,CHILD, CHILD as CHILDNAME INLINE [
PARENT,CHILD
, NG04241DE00
NG04241DE00, PAL002
NG04241DE00, BOL006
NG04241DE00, INC038
NG04241DE00, NG04241DI00
NG04241DI00, CAJ001
NG04241DI00, PA46NG000];
In my data I was missing the "parentless child" for the root!!
Thanks!