Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP & Luminary
MVP & Luminary

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
Highlighted
MVP & Luminary
MVP & Luminary

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

Highlighted
Specialist II
Specialist II

HI John,

PFA the sample app.

Hope this is the requirement...

Highlighted
Specialist
Specialist

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

Highlighted
Specialist
Specialist

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.

Highlighted
Specialist II
Specialist II

OK No problem,

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

What was the issue???

Highlighted
Specialist
Specialist

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.