Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
gerrycastellino
Creator III
Creator III

Simple Question on making active only hierarchy selected

I have several hierarchies coming into a list object displayed as tree view.

I have an expression to display the tree structure, which cannot be changed - I cannot use the PATH for some other technical reasons.

How can I just make the only visible hierarchy in my tree structure view, the hierarchy I have selected in my hierarchy name list box ?

hierarchy.PNG

attached is  the ".qvw"  and the hierarchy .qvd.

Any help appreciated !

1 Solution

Accepted Solutions
Not applicable

Please see attached file. I've created two alternative list boxes one using your expression and one using the hierarchy path. When hierarchy name is selected the tree view listbox only displays the visible hierarchy. Hope this works. p.s do check whether the use of nested ifs in your expression can cause performance issues.

regards

sana

View solution in original post

10 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

Hi Gerry,

Try Hide Excluded flag in Listbox properties

Hope it helps

Regards,

Sergey

Regards,
Sergey
gerrycastellino
Creator III
Creator III
Author

‌cannot use hide exlcuded - due to other technical / display reasons

is there another way to accomplish this ?

SergeyMak
Partner Ambassador
Partner Ambassador

Yes. You can create four listboxes and show in conditionally based on what is selected in your other listbox.

For example a condition will be HIERARCHY_NAME='FPA (Dafault)'

etc.

Regards,

Sergey

P.S.: It would be good to know what technical limitation do you have.

Regards,
Sergey
Not applicable

Please see attached file. I've created two alternative list boxes one using your expression and one using the hierarchy path. When hierarchy name is selected the tree view listbox only displays the visible hierarchy. Hope this works. p.s do check whether the use of nested ifs in your expression can cause performance issues.

regards

sana

gerrycastellino
Creator III
Creator III
Author

OMG ! Wow ! I think you worked it out !   I need to look at this further.

Let me know where I can send the box of chocolates

but one question:  why do you have the 'if' statement repeating.

can you explain your pick(match  in English syntax ...

Gerry.

gerrycastellino
Creator III
Creator III
Author

HI Sergey:

My requirements are that I do not know how many hierarchies I will be importing, I needed it to be totally flexible to accomodate an unknown limit. Can't have a static number of list boxes.

Gerry.

Not applicable

The pick match is being used instead of multiple ifs here…..

so in this EXPRESSION:

pick(match(GetSelectedCount(HIERARCHY_NAME),0,1), 

hierarchy_tree,

pick(match(HIERARCHY_NAME,GetFieldSelections(HIERARCHY_NAME)),hierarchy_tree))

THE PICK(MATCH is doing something like below:

if GetSelectedCount(HIERARCHY_NAME)=0 then the listbox returns the field hierarchy_tree

and if GetSelectedCount(HIERARCHY_NAME)=0 then it returns listbox for the expression if(HIERARCHY_NAME=GetFieldSelections(HIERARCHY_NAME),hierarchy_tree)

Not applicable

not very sure but if the if statement isn't repeated then the list box appears blank when nothing is selected in hierarchy_name.

so you can't use the path field instead of the expression in the list box?

gerrycastellino
Creator III
Creator III
Author

ok I think I understand this.

I cannot use the hierarchy_tree, as I need some fine control over the hierarchy in being able to detect what levels

have been chosen,  hierarchy_tree does not let me do that, but the if does.

Gerry.