Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i build a hierarchy load based off this info

I am trying to build i hierarchy that comes from a flat file:



I tried stacking the Nodes into one table then joining in the parent codes from the level above, but it doesn't see to be working any advice?

I would like to build a treeview from level 6 to level 1. Thanks.

6 Replies
pover
Partner - Master
Partner - Master

QlikView hierarchy functions expect a table with the columns NodeID, NodeName and ParentNodeID. The table you have in Excel actually would be result the Hierarchy() function would give you. Now if you want have a result like the HierarchyBelongsTo() would give you with all the nodes in one column try first creating a table with NodeID, NodeName and ParentNodeID with the following script:

Node_Parent_Table:
Load distinct Product as NodeID,
Product_Description as NodeName,
[(EPRD6) Essbase Level 2] as ParentNodeID
From x.xls;
concatenate
Load distinct [(EPRD6) Essbase Level 2] as NodeID,
[Level 2 Desc] as NodeName,
[(EPRD5) Essbase Level 3] as ParentNodeID
From x.xls;
concatenate
etc...

then call the Node_Parent_Table with the resident command and do a hierarchybelongsto() function over that table.

Regards.

Not applicable
Author

Okay I dont have enough memory to do this function for all the levels i get an allocating more memory error followed by a crash, but if i do just the top three levels it works. Once i have the set up like

Ancestor ID | AncestorName | NodeID | NodeDesc

How do i make a treeview selector?

pover
Partner - Master
Partner - Master

You should be able to do the treeview selector without doing what I mention. Just load an additional field to the flat file you have that is like the following:

Load ...
Level1 &'/'& Level2 &'/'& Level3 as TreeViewField,
...
From...

Then create a listbox and enable the 'Show as TreeView' option.

Regards.

Not applicable
Author

WIll you still be able to make selections on all of the levels or just the lowest level?

pover
Partner - Master
Partner - Master

Good point. I think you're right, so you'd have to do something like the following, but I don't think you'll be able to do it with your limited memory.

Load Level1,
sum(Total) as Total,
Level1 as TreeViewField
From ...
Group by Level1;

concatenate

Load Level1,Level2,
sum(Total) as Total,
Level1 & '/' & Level2 as TreeViewField
From ...
Group by Level1,Level2;

concatenate

etc.

pover
Partner - Master
Partner - Master

Good point. I think you're right, so you'd have to do something like the following, but I don't think you'll be able to do it with your limited memory.

Load Level1,
sum(Total) as Total,
Level1 as TreeViewField
From ...
Group by Level1;

concatenate

Load Level1,Level2,
sum(Total) as Total,
Level1 & '/' & Level2 as TreeViewField
From ...
Group by Level1,Level2;

concatenate

etc.

Regards.