Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
You need to use a data set with two dimensions that define the tree structure.
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 |