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.

gerrycastellino
Contributor 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 !

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: Simple Question on making active only hierarchy selected

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

10 Replies
sergey_maka8
Valued Contributor

Re: Simple Question on making active only hierarchy selected

Hi Gerry,

Try Hide Excluded flag in Listbox properties

Hope it helps

Regards,

Sergey

gerrycastellino
Contributor III

Re: Simple Question on making active only hierarchy selected

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

is there another way to accomplish this ?

sergey_maka8
Valued Contributor

Re: Simple Question on making active only hierarchy selected

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.

Not applicable

Re: Simple Question on making active only hierarchy selected

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
Contributor III

Re: Simple Question on making active only hierarchy selected

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
Contributor III

Re: Simple Question on making active only hierarchy selected

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

Re: Simple Question on making active only hierarchy selected

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

Re: Simple Question on making active only hierarchy selected

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
Contributor III

Re: Simple Question on making active only hierarchy selected

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.

Community Browser