Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with hierarchy and "Show as Tree View"

Hello,

there is an Employee table which contains a Employee-Manager(another employee) relation in the form of hierarchy. I would like to have it displayed as a tree, similar to this example from Reference Manual:

error loading image

In the script I put the following code:


hierarchy(EMPLOYEE_ID, MANAGER_ID, NODENAME)
LOAD "EMPLOYEE_ID",
"FIRST_NAME" & ' ' & "LAST_NAME" & ' (' & EMPLOYEE_ID & ')' as NODENAME,
EMAIL,
"MANAGER_ID",
SQL SELECT *
FROM HR.EMPLOYEES;


When the list box is created with the nodename field, and "Show as Tree View" is selected nothing happens on the display; it is plain listbox as everyone is used to.

Could anyone help me to understand what I miss with the code above?

Thank you,

bartek

5 Replies
Not applicable
Author

Hierarchies are common objects in many BI tools, and mostly are created with ease. I have quite opposite feeling with QV, ie. they are not so obvious to represent.

Do I make any error in my code? Could anyone point me to working example?

Thank you,

bartek

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You need to create the "PathName" field for use in the Listbox. For example:

hierarchy(EMPLOYEE_ID, MANAGER_ID, NODENAME, , , ReportPath)

and then use ReportPath in the Listbox. See attached example qvw.

-Rob

Not applicable
Author

Thanks a lot! I misunderstood the description of the optional fields from the reference manual.

I have another question: if pivot table is created with hierarchy fields, for example node1..node4, and the source data is updated so that another level in hierarchy is added ie. node5, is it possible to do that this added level would be visible automatically in previously created pivot table without updating it "manually"?

thank you,
bartek

Not applicable
Author

hello bartekmaj have you find and answer to this i have the exact same problem, thanks in advance greetings

Not applicable
Author

bartekmaj wrote:

Thanks a lot! I misunderstood the description of the optional fields from the reference manual.

I have another question: if pivot table is created with hierarchy fields, for example node1..node4, and the source data is updated so that another level in hierarchy is added ie. node5, is it possible to do that this added level would be visible automatically in previously created pivot table without updating it "manually"?

thank you,
bartek

Yes, I was wondering the very same thing....... how do you do that?