Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
fks
Contributor III
Contributor III

hierarchical data model

Hi,

I have a set of hierarchical data like this:

LOAD * Inline [
MEMBER, TEAM, BOSS, HIERARCHIAL
Donald Duck, Alpha, 2, Yes
Mickey Mouse, Alpha, 1, Yes
Trasan Apanson, Alpha, 1, Yes
Donald Duck, Beta, 1, Yes
Trasan Apanson, Beta, 2, Yes
Donald Duck, Gamma, 0, No
Mickey Mouse, Zeta, 0, No
Trasan Apanson, Zeta, 0, No
Mickey Mouse, Pi, 2, Yes
Trasan Apanson, Pi, 2, Yes
Donald Duck, Pi, 1, Yes
];

Now I would like to display the hierarchy of the different Teams, i.e. the name of the Boss (if there is a boss on the team, may also be more than one boss on a single team) and the related servants (one or more, present on every team).

I want to fill the table at the bottom... Smiley Happy

2019-04-03 11_02_38-Qlik Sense Desktop.png

(Sample data & tables attached as a qvf )

3 Replies
Vegar
MVP
MVP

Please explain your data? How can I read the data to understand who is the boss for Zeta or Beta team?
fks
Contributor III
Contributor III
Author

Hi Vegar,

2 is boss. If the team have one or more bosses the servant(s) ranks as 1. For teams without a boss the servant(s) ranks as 0.

/BR

Vegar
MVP
MVP

What if you did something like this?

[TEAMS]:
LOAD * Inline [ 
    MEMBER, TEAM, BOSS, HIERARCHIAL
    Donald Duck, Alpha, 2, Yes
    Mickey Mouse, Alpha, 1, Yes
    Trasan Apanson, Alpha, 1, Yes
    Donald Duck, Beta, 1, Yes
    Trasan Apanson, Beta, 2, Yes
    Donald Duck, Gamma, 0, No
    Mickey Mouse, Zeta, 0, No
    Trasan Apanson, Zeta, 0, No
    Mickey Mouse, Pi, 2, Yes
    Trasan Apanson, Pi, 2, Yes
    Donald Duck, Pi, 1, Yes
];

Bosses:
LOAD 
TEAM,
MEMBER as [Boss (name)]
Resident TEAMS
WHERE BOSS =2;

Servants:
LOAD 
TEAM,
MEMBER as [Servant (name)]
Resident TEAMS
WHERE BOSS =1;