Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
marcohadiyanto
Partner - Specialist
Partner - Specialist

Hierarchy Problems

Dear all,

I have problems with hierarchy, when i want to choose just africa not parts of africa why the cursor can't static at africa?

here is my code



T1:
LOAD * INLINE [
ID, Name, ParentID, ParentName
1, Perth, 1, Australia
2, London, 2, Europe
3, UK, 2, Europe
4, British, 2, Europe
5, France, 2, Europe
6, Italy, 2, Europe
7, Rome, 6, Italy
8, Africa, 8, Africa
9, Nigeria, 8, Africa
10, South Africa, 8, Africa
];

LOAD *,
ParentName &'+'& Name as Path
Resident T1;DROP Table T1;


need advice,

thanks,

Marco

4 Replies
Not applicable

Hi

Not sure to understand your problem.

Have a look to the app. I can select use the hierarchy.

JJ

marcohadiyanto
Partner - Specialist
Partner - Specialist
Author

hi, thanks for reply

what i mean is, i want to make one list hierarchy.

but the root can't be choose.

Marco

Not applicable

Hi Marco,

Copy this code and reload , you will get the result.

T1:
LOAD * INLINE [
ID, Name, ParentID, ParentName
1, Perth, 1, Australia
2, London, 2, Europe
3, UK, 2, Europe
4, British, 2, Europe
5, France, 2, Europe
6, Italy, 2, Europe
7, Rome, 6, Italy
8, Africa, 8, Africa
9, Nigeria, 8, Africa
10, South Africa, 8, Africa
];



T2:
Concatenate
Load
ID,
ParentName as Name,
ParentID
Resident T1;



hierarchy(ID,ParentNode,Name,TEST,Name,PATH)

Load
ID,
ParentID as ParentNode,
Name
Resident T1;

drop table T1;

Regards,

Prabhu

Not applicable

Hi Marco,

reload this code, you will get the correct result

T1:
LOAD * INLINE [
ID, Name, ParentID, ParentName
1, Perth, 1, Australia
2, London, 2, Europe
3, UK, 2, Europe
4, British, 2, Europe
5, France, 2, Europe
6, Italy, 2, Europe
7, Rome, 6, Italy
8, Africa, 8, Africa
9, Nigeria, 8, Africa
10, South Africa, 8, Africa
];


AdjacentNodesTable:
LOAD null() AS Parent, ParentName AS NodeID, ParentName AS NodeName,ID RESIDENT T1;
LOAD ParentName AS Parent, Name AS NodeID, Name AS NodeName,ID RESIDENT T1;
LOAD Name AS Parent,ID RESIDENT T1;

hierarchy(NodeID,ParentN,NODES,TEST,NODES,Path)
Load
NodeID,
Parent as ParentN,
NodeName as NODES

Resident AdjacentNodesTable;

DROP FIELD NodeName FROM AdjacentNodesTable;

Enable the option show as treeview in Properties list box.

Regards,

Prabhu