Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Hierarchical Report Issue
dbmathis
Hi All,<br />
<br />
I am working on a report that will a hierarchical structure with one manager at the top, and then employees and managers under the top manager (level 2), and then for the level 2 managers employees and managers under them (level 3) and so on. The problem being that the data doesn't have the current level that each employee or manager is in the hierarchy.<br />
<br />
Right now I have managed to identify the top level manager (stored in a global variable) and I have created a global java hash map that has all managers (keys) in it, and the for each manager (key) the value for the key is a list (direct subordinates / employees and managers reporting to the manager in the key).<br />
<br />
The hash map looks like:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>{
top manager=[employee a, employee b, manager a],
manager a=[employee c, manager b],
manager b=[manager c, manager d, employee d],
manager c=[employee e],
manager d=[employee f]
}</pre>
<br />
What I need to do is build a scripted data set from the hash map that has each level that the manager and employee is in so that I can bind to the data set, group by level and then manager and then sort by the level and manager.<br />
<br />
Has anyone done this or know what the code would look like to build this data set. I am at a loss.<br />
<br />
<br />
<br />
Perhaps there's a better way? Basically I need to group level the that manager is in the hierarchy and then group by manager. Then sorted by level ascending and then manager.
Find more posts tagged with
Comments
dbmathis
Ok, I have managed to get the managers and their levels in a global hashmap that looks like this...
{Jessica Frys=2, MARIA Collins Brown=2, Bill Wells=1}
How do I get this hashmap data into the report so that I can group my XML sourced data set by level (the hash values). I have a field in my dataset row["manager"] that should match up on the key values of my hashmap.
Anyone have any quick pointers?
dbmathis
I sorted this one out on my own. Will paste the solution shortly.
kclark
Glad you got it working! Is everything still working as expected now?