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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

hierarchy in script

Hi All

i tired search in community  i am bit confused with Node Id and Node Name , Parent Name etc

Can  any help me on hierarchy in list box.

Hierarchy ( employee Manager , employee in reporting hierarchy format).



I have  data as follows


employee      manager

Uday            sagar

krishna         uday

sumanth     Sagar

pavan         saritha

please help on this

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this?

Hierarchy function easy and Efficient with example---

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

11 Replies
Anil_Babu_Samineni

Don't create 2 threads for single issue?

Re: Hierarchy

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi Anil ,

in  Re: Hierarchy it  worked   for me  using expression in  front end , But i want to know  how can we do it in back end also  so i  had recreated ticket

Thanks

Anil_Babu_Samineni

Try this?

Hierarchy function easy and Efficient with example---

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks  Anil .

Anonymous
Not applicable
Author

Mahesh, just do the expression in the  load script and use it in list box enabling the tree view.

load *,upper(manager)&'/'&upper(employee) as hier;

load * Inline

[

employee,manager

Uday,Sagar

krishna,Uday

sumanth,Sagar

pavan,saritha];

Anonymous
Not applicable
Author

Hi Nagesh ,

Thanks for advice need to implement in script

Anonymous
Not applicable
Author

Mahesh, The above comment is building in the script itself. Do you need something else?? like using Hierarchy prefix??

Anonymous
Not applicable
Author

Yes  Nagesh . i need it using Hierarchy prefix

Anonymous
Not applicable
Author

Mahesh, I changed your data a bit and used hierarchy

Hope its helps.

//test:

//load * Inline

//[

//employee,manager

//Uday,Sagar

//krishna,Uday

//sumanth,Sagar

//pavan,saritha];

test:

load * Inline

[

empid,mgrid,empname

1,,Sagar

2,1,Uday

3,2,krishna

4,1,sumanth

5,,saritha

6,5,pavan];

node:

Hierarchy (empid,mgrid,Node, NodeParent, Node,NodePath, '/', NodeDepth)

Load empid,mgrid,empname as Node

Resident test;

drop table test;

Now use "NodePath" as field in your listbox.