Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Unexpected behavior for listbox shown as Treeview

Hello,

I have the following hierarchy:

PathNodeNodeIdParentId
AAAAAA1
AAA>BBBB21
AAA>BB>CC32
AAA>CCCC41

I displayed in a listbox with the option

Listbox.png

But then when I click on the first node 'AAA', the selection is different whether the node is collapsed or expand.

When Collapsed:

Listbox-Collapsed.png

When Expanded:

Listbox-Expanded.png

I understand the concept, but how to force the selection of "sub node" when the selected node is expanded?

1 Solution

Accepted Solutions
hic
Esteemed Contributor III

Re: Unexpected behavior for listbox shown as Treeview

The Treeview list box is designed to do exactly this: Collapsed node and you select the entire sub-tree; Expanded node and you select the node only.

If you want to select the entire sub-tree, you will have to click-and-drag so that you mark several field values.

Or - you change your data model so that you get a "Tree" table also. See http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/11/unbalanced-n-level-hierarchies. A selection in the "Path" field in this table will link to entire sub-trees.

HIC 

5 Replies

Re: Unexpected behavior for listbox shown as Treeview

Document Properties > Triggers > Field Event Triggers > Path > On Select > Add Action(s):

Add > Select in Field

Field:

=if(GetSelectedCount(Path)>0, 'Path')

Search String:

='(' & concat({1<Path={$(=concat(chr(39) & Path & '*' & chr(39), ','))}>}distinct Path,'|') & ')'

I have attached the working file.

hic
Esteemed Contributor III

Re: Unexpected behavior for listbox shown as Treeview

The Treeview list box is designed to do exactly this: Collapsed node and you select the entire sub-tree; Expanded node and you select the node only.

If you want to select the entire sub-tree, you will have to click-and-drag so that you mark several field values.

Or - you change your data model so that you get a "Tree" table also. See http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/11/unbalanced-n-level-hierarchies. A selection in the "Path" field in this table will link to entire sub-trees.

HIC 

Highlighted
Not applicable

Re: Unexpected behavior for listbox shown as Treeview

Hi Henric,

I have applied your suggestion and it is working 100% fine.

Now, when I used the fields automatically created by the hierarchy, within the pivot, with indent mode, is it possible to stop the expand functionality [+] when there is no more child?

Here is my related post:

Pivot - Indent &amp; Expand

I wish also to disable expand/collapse for dimension that I put in column, but I can't find any solution.

I noticed 2 ideas (related to this topic) have been posted on the forum. Quite hopeless to have this soon since they were posted in 2011...

http://community.qlik.com/ideas/1972

http://community.qlik.com/ideas/2170

hic
Esteemed Contributor III

Re: Unexpected behavior for listbox shown as Treeview

No, unfortunately there is no way to stop the expand functionality. In principle, a collapsed node is a subtotal, and the expanded show the real values. What you want, is to allow subtotals in some positions in the chart, but not in others. And that is not possible.

HIC

agni_gold
Valued Contributor

Re: Unexpected behavior for listbox shown as Treeview

Hi,

I have a situation where this is failing..

xcv.jpg

When I am selecting TerexUtilities both TerexUtilities and TerexUtilitiesUSDist are getting selected.

Please tell me how to handle this..