Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hierarchy

Hi,

I'm struggling with the Hierarchy load, and would surely need some help. The reference manual is not very extensive in this particular area.

Attached is aa  example with just a small amount of data, but it shows how my data set will look like. Basically it is a bill of material structure, where I want to first build the hierarchy and then add some features.

I am primarily focusing on 3 columns of data. First column contains all items that have a child (a structure that should be able to expand). Second column contains the child item and third column contains the quantity of the child that goes into the parent.

ParentChildQuantity
121
11000.5
11011
232
24

2.5

2208
22005

3

300.05
33001
44005
44017
2020000.9
30300010

As you can see, Item 1 consists of item 2, 100, and 101 while in turn, item 2 also is a parent. There are basically no limitations in how many items or how many levels there can be.

What I would like to see is a tree structure that can be expanded for each parent, and also the possibility to select a child to see which parents it belongs to. In addition, I would also like to see the quantity within the tree structure (if possible).

As a final tweak, it would be awesome if I could load a quantity that should be produced, and get the total required amount of all items in the hiearchy. As example; I load a production quantity of 1000 for item 1, meaning it will require 1000 units of item 2, while that would require 2000 units of item number 3 and so on and so forth.

Any help with this would be very much appreciated, even if it is not the entire solution.

The attached example is just in its beginning. First hick-up is that I cannot get all parents to load in level 1 unless I add them as childs with no parent.

Best regards

Robert

1 Solution

Accepted Solutions
Henric_Cronström

You need to have one row per node. I.e. you should have a row also for node number 1 (with a blank or NULL as parent).

Then you should be able to load the hierarchy using

Hierarchy (NodeID, ParentID, NodeName, ParentName, Child, Path, '/', Depth)

Load

     Parent as ParentID,

     Child as NodeID,

     Child as NodeName,

     Quantity

     From ...

Once you've done that, the tree structure is there in a List box (use the field "Path") and the quantity can be summed in a pivot table.

HIC

View solution in original post

2 Replies
Not applicable
Author

Hi,

I try to bump this once, still hoping to get a tip or suggestion of how to start .

Kind Regards

Robert

Henric_Cronström

You need to have one row per node. I.e. you should have a row also for node number 1 (with a blank or NULL as parent).

Then you should be able to load the hierarchy using

Hierarchy (NodeID, ParentID, NodeName, ParentName, Child, Path, '/', Depth)

Load

     Parent as ParentID,

     Child as NodeID,

     Child as NodeName,

     Quantity

     From ...

Once you've done that, the tree structure is there in a List box (use the field "Path") and the quantity can be summed in a pivot table.

HIC