Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

johncaqc
Valued Contributor

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

Re: Username/Department Roll-up Logic

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


talk is cheap, supply exceeds demand
6 Replies
MVP & Luminary
MVP & Luminary

Re: Username/Department Roll-up Logic

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


talk is cheap, supply exceeds demand
gupta_n8
Valued Contributor II

Re: Username/Department Roll-up Logic

HI John,

PFA the sample app.

Hope this is the requirement...

johncaqc
Valued Contributor

Re: Username/Department Roll-up Logic

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

johncaqc
Valued Contributor

Re: Username/Department Roll-up Logic

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.

gupta_n8
Valued Contributor II

Re: Username/Department Roll-up Logic

OK No problem,

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

What was the issue???

johncaqc
Valued Contributor

Re: Username/Department Roll-up Logic

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.

Community Browser