Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview Hierarchy function

Hi All,

I have a sample table below where columns left and right are connected through joins eg-A is joined to B through Many to One join.

I want to build something in Qlikview where if I click on A it should give me B (1 level) and also E (because A->B and B->E) and should tell (2 levels).

I think Hierarchy function will be used but I'm not able produce the desired result.

Join IdLeftRightJoin
1ABMany To One
2ACMany To One
3ADMany To One
4BAOne To Many
5GDOne to One
6BEMany To One

Any help would be really appreciated.

9 Replies
MarcoWedel

can you draw the hierarchy described by your sample data?

Not applicable
Author

Hi,

I'm not sure if it is a hierarchy or not but I want 3 listboxes - Left, Right and Number of levels. If I click on A in left, it should give me B and show number of levels as 1 and E with number of levels as 2. Something like transitive dependency, because in this case B-E relation is not direct.

beck_bakytbek
Master
Master

Hi Harshit,

check this

Qlikview - Hierarchy vs Hierarchy belongs to - YouTube

i hope that helps

beck

Not applicable
Author

Hi Beck,

Can you please give me an example with my data?


Harshit

vinieme12
Champion III
Champion III

Like this??

hierarchy.JPG

LOAD SCRIPT:

Hierarchy:

LOAD * INLINE

[

Main,Level1

A,B

A,C

A,D

B,A

G,D

B,E

];

LEFT JOIN

LOAD

Main as Level1,

Level1 as Level2

RESIDENT Hierarchy;

List boxExpression:  

=Main & '-'&Level1&'-'&Level2

Select: Show as Tree view , With Seperator:  - (Hyphen)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Thanks for the answer. Really appreciate this. But this solution will limit me to 3 levels only. I have a huge data collection. Is there any alternative solution

vinieme12
Champion III
Champion III

Okay, how many hierarchies do you have?

We can loop the code if this  is the output you are looking for?

Meanwhile I'll look for an alternate solution too

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

There is no method to determine the number of hierarchies. It may change with the data.

vinieme12
Champion III
Champion III

Can you provide a sample that replicates your data? You've only provided 2 columns to work with..

We'll need to determine what you are working with to help you better

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.