Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register 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

Labels (1)
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

tresB
Champion III
Champion III

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