Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
johnca
Specialist
Specialist

Username/Department Roll-up Logic

Hello all,

I've been struggling with some logic that will return department number roll-ups to the highest level, in this case the queen bees.

My data is like this...

UsernameTitleDepartmentManager
JoeWorker Bee200King Bee 1
MaryWorker Bee300King Bee 2
LarryKing Bee 1450Queen Bee 1
MoKing Bee 2475Queen Bee 2
AnitaQueen Bee 1100
ToniQueen Bee 2105
El JeffeWorker Bee335King Bee 2
ShempWorker Bee250King Bee 1

I need to return data rolled up by Queen like this...

Queen BeeDepartments
Anita200
Anita450
Anita100
Anita250
Toni300
Toni475
Toni105
Toni335

Thanks,

John

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You're looking for the Hierarchy function. See this blog post: Unbalanced, n-level hierarchies


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

You're looking for the Hierarchy function. See this blog post: Unbalanced, n-level hierarchies


talk is cheap, supply exceeds demand
Anonymous
Not applicable

HI John,

PFA the sample app.

Hope this is the requirement...

johnca
Specialist
Specialist
Author

Thank you Gysbert...will take some time to digest this...am slammed.

johnca
Specialist
Specialist
Author

Thank you, too Nitin. I applied this logic to my dataset and it didn't turn out as expected. Hope to get back to this but am slammed with other projects.

Anonymous
Not applicable

OK No problem,

But as I understood, the output was same as in you mentioned...

What was the issue???

johnca
Specialist
Specialist
Author

Hi Nitin, my pseudo dataset may be wrong. I like being told the answer, but to understand the hierarchy function I really need to dig into the documents Gysbert pointed me towards.