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: 
Not applicable

create a list box as TreeView having only complete dinamic path of a document

good morning,

i have a problem with list box selection in treeview mode.

in the Structure I have only a document and his full path(one document can have a different path level) but when i select a parent node no document selcted.

I attached a simply example to understand my problem.

can someone help me?

many thanks for you attention and have a good day

1 Solution

Accepted Solutions
MarcoWedel

Hi,

to be able to select nodes by their parents, those have to have rows of their own in the hierarchy field.

So one solution could be:

QlikCommunity_Thread_133098_Pic1.JPG.jpg

QlikCommunity_Thread_133098_Pic2.JPG.jpg

TTREE:

LOAD * INLINE

[DOC,PATH,DESCRIPTION

doc1, B/B0/B00/B00001,DESC 1

doc2, B/B0/B00/B00002,DESC 2

doc3, B/B0/B00/B00003,DESC 3

doc4, B/B0/B01/B01001,DESC 4

doc5, B/B0/B01/B01001/B010001,DESC 5

doc6, A/A0/A00/A00001,DESC 6

doc7, A/A0/A00/A00002,DESC 7

doc8, A/A0/A00/A00002,DESC 8

];

LOAD PATH,

     Left(PATH,Index(PATH&'/','/',IterNo())-1) as PATH_SELECT

Resident TTREE

While IterNo()<=SubStringCount(PATH,'/')+1;

hope this helps

regards

Marco

View solution in original post

6 Replies
tresesco
MVP
MVP

You should learn about qv hierarchy: Hierarchies

Not applicable
Author

thanks for the link

unfortunatly i don't find anithing that can help me.i find only example about static structure or strcture already right or structure with parent-child column.

many thanks for your attention

tresesco
MVP
MVP

Yes, there has to be a child-parent relationship, if not existing in the desired format, you have to play in the script a bit to create one. Is your source data really like what you showed in inline table?

Not applicable
Author

Yes, in my source data the value have the same structure that i put in inline table,

thanks a lot

MarcoWedel

Hi,

to be able to select nodes by their parents, those have to have rows of their own in the hierarchy field.

So one solution could be:

QlikCommunity_Thread_133098_Pic1.JPG.jpg

QlikCommunity_Thread_133098_Pic2.JPG.jpg

TTREE:

LOAD * INLINE

[DOC,PATH,DESCRIPTION

doc1, B/B0/B00/B00001,DESC 1

doc2, B/B0/B00/B00002,DESC 2

doc3, B/B0/B00/B00003,DESC 3

doc4, B/B0/B01/B01001,DESC 4

doc5, B/B0/B01/B01001/B010001,DESC 5

doc6, A/A0/A00/A00001,DESC 6

doc7, A/A0/A00/A00002,DESC 7

doc8, A/A0/A00/A00002,DESC 8

];

LOAD PATH,

     Left(PATH,Index(PATH&'/','/',IterNo())-1) as PATH_SELECT

Resident TTREE

While IterNo()<=SubStringCount(PATH,'/')+1;

hope this helps

regards

Marco

Not applicable
Author

great!!!

works fine!

many thanks again and have a nice day!