Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bhaskarsharma03
Creator
Creator

TreeView question

Hi,

I am trying to create a TreeView listbox with fields Region, Country and City. My TreeView allows me to select the value at the lowest level (City in my case), but I am not able to select values in Country and Region.

How can I make it work when I select Country and Region as well? The reference app is attached herewith.

Regards,

Bhaskar

2 Replies
hic
Former Employee
Former Employee

You cannot use TreeView this way. The tree view is made to show hierarchies where each node has a record of its own in the source data. E.g.: "EU", "Canada" and "NA" should all have their own records. In your case, only the lowest level in the hierarchy has their own records.

One way to load your table so that this demand is fulfilled, is the following:

Load City as NodeID, Region, Country, City, Region &'/'& Country &'/'& City as Path From ... ;

Concatenate Load Country as NodeID, Region, Country, Region &'/'& Country as Path From ... ;

Concatenate Load Region as NodeID, Region, Region as Path From ... ;

Another. better way, is to store the data as an adjacent nodes table, and to load it with a Hierarchy prefix.

Read more here: Hierarchies.

HIC

tresesco
MVP
MVP

Have a look at this discussion too: Treeviewer problem while expanding