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

Hierarchies - problems with sub-trees

Hi everyone,

New to Qlikview and continuing with my growing pains.

I am struggling to implement a simple 3-level hierarchy where each level can be selected in a tree-view list box and show all associated values. I have followed Henric Cronstrohm's PDF manual as closely as possible. I am attaching it here for reference.

I am attaching the Excel file I used to construct the hierarchy. I have successfully created the two hierarchy tables, Hierarchy - ExpandedNodes and Hierarchy - AncestorTable. They are correctly linked to each other, and the rest of my data, by the field SegID (i.e. Node ID). There is only one other table. The list box is also displaying correctly, and I can select all levels. However, when I select higher levels, they return 0 values! Why are they not rolling up?

I would greatly appreciate anyone taking a quick look at my Excel file to see if I did anything wrong. Here is my current script:

Hierarchy(SegID, ParentID, Node, NodeParent, Node, NodePath, '|', NodeDepth)

LOAD SegID,

    ParentID,

    NodeName as Node

FROM

[\\e\QlikView\Data\ServiceSegmentation.xlsx]

(ooxml, embedded labels, table is Hierarchy);

HierarchyBelongsTo(SegID, ParentID, NodeName, TreeID, TreeName)

LOAD SegID,

    ParentID,

    NodeName

   

From

[\\e\QlikView\Data\ServiceSegmentation.xlsx]

(ooxml, embedded labels, table is Hierarchy);

RENAME Field Node1 to Sector;

RENAME Field Node2 to Segment;

RENAME Field Node3 to Subsegment;

3 Replies
whiteline
Master II
Master II

Hi.

They are not rolling up as there is no data associated with SegID (40 for example).

Read from the page 16, Henric Cronström describes exactly the issue that you have and the way to handle it.

Not applicable
Author

Hi Whiteline,

Thanks for responding!

From what I understand, I should have handled this problem by adding the Ancestor table, with the HierarchyBelongsTo function. This creates a second table with a Parent ID, so that Qlikview knows which sub-nodes are assigned to which node. That way, even if my data has no line associated with SegID 40, Qlikview will roll up all the lower levels.

HierarchyBelongsTo is described on page 16. Or were you referring to the instructions to add a third table for TreeID? I tried adding it, but it didn't fix my problem.

whiteline
Master II
Master II

There are some pictures with instructions.

It seems that you are using the wrong field for selection. You shoul use the one that have the association with SegID 40.