Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
New-here1
Contributor III
Contributor III

Help! Org Chart

Hello,

I need help with creating an org chart - the only data I have is the below:

- Parent ID, Parent Name, Child ID and Child Name

It is a HUGE data set (thousands of lines of data) but I want to show which children (and how many) associate to a parent for example, Parent 1 has 3 children associated to it, and I want this to show like an org chart. 

I have read through lots of examples and coming up empty as they do not appear to be working for me , likely due to the fact that only have the 4 columns above. 

Can this be done through coding in the data load script, and if so, please could someone provide an example/help?

Thank you in advance

Labels (4)
3 Replies
Dalton_Ruer
Support
Support

You would need to do some work in the load script like the following to flatten out your structure. 

StartingData:
Load * Inline [
Parent ID, Parent Name, Child ID, Child Name
5, Dalton, 100, Hillary
5, Dalton, 101, Ashley
10, Laura, 102, Fred
10, Laura, 103, Sally Sue

];

OrgData:
Load DISTINCT 
0 as ParentID,
[Parent ID] as NodeId,
[Parent Name] as NodeName
resident StartingData;

Load
[Parent ID] as ParentID,
[Child ID] as NodeId,
[Child Name] as NodeName
resident StartingData;

Drop table StartingData;

 

Then configure your org chart like this

OrgProperties.png

 

RahulGupta-HCL
Contributor II
Contributor II

You need to use a data set with two dimensions that define the tree structure.

  • The first dimension needs to be the ID of the node. This would typically be an employee ID in a traditional organization chart.
  • The second dimension needs to be the ID of the parent node. This would typically be the employee ID of a manager.

    This connects to the first dimension to create a tree structure.

    If this value is empty or points to a node that does not exist, the node becomes a root node at the top of the tree.

  • Child ID Parent ID Name
    A101 A100 Mary Bell
    A102 A101 John Bialik
    O101 A100 Lee Mayer
    I101 A101 Wendy Sanderson
    T101 A101 Asim Nawrat
    T102 T101 Emily Diaz
    T103 T101 Christine Nemic
Thanks
Rahul Gupta
Solution Architect- Data Engineering, Analytics & Data Science at HCL Technologies