Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to create a hierarchy structure. My sample data is shown in the below table
User | Manager |
Satish | Murali |
Murali | Jayesh |
Abdul | Jayesh |
Jayesh | Venkat |
Aarti | Venkat |
I tried creating a hierarchy using pivot table, but the structure created is incorrect as the manager name appears in user column.
The expected structure I am looking for is as below with the +/- symbols
Venkat | Aarti | ||
Jayesh | Abdul | ||
Murali | Satish |
Can someone help me with this?
Hi Saurabh,
I cannot quite think it out, but I think you need a LOOP as you will have to go throu all the records several times:
- look for a name (that is not present in the "User" column, so this person does not have a higher manager)
=> Take that name and read all the records where it is in the "Manager" column
=> Read the name(s) in the "User" column
=> Look for this name in the "Manager" column
(LOOP)
HTH
Best regards,
DataNibbler
why not use a hierarchy? check it out in the manual or :
You should definitely use a Hierarchy prefix:
Hierarchy (UserID, ManagerID, UserName, ManagerName, UserName, Path, '/', Depth)
Load
User as UserID,
Manager as ManagerID,
User as UserName
Inline
[User,Manager
Satish,Murali
Murali,Jayesh
Abdul,Jayesh
Jayesh,Venkat
Aarti,Venkat
Venkat,];
Then you can use the created fields both for a pivot table and a tree-view list box. See more on http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/11/unbalanced-n-level-hierarchies
HIC