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

listbox with treeview will not sort properly

Hi,

I have listbox setup as treeview to represent customer structure. Qlikview display the hierarchy properly, but if you try to search, selection wil not rise to the top of the list eventhough the sort is set to  state: Auto ascending . You have no choice but to scroll down to the original location of the value. As list contains over 40K values this becomes a problem...

Example attached.

4 Replies
Not applicable
Author

Unfortunately selection remains in the same position.

Not applicable
Author

I use a Macro to fix this issue.  I do have one list box working perfectly but another doesn't so I cant promiss it will be 100%.  I am currently trying to make this bullet proof but hopefully it should be fine for your purpose.

How to:

  1. Add a text box. e.g. "Update account list"
  2. Click on actions tab and add a "External" -> "Run Macro"
  3. Call the Macro something and then press edit module. e.g. "AccountPathRefresh"
  4. Copy the below into the module and update the sub ************* to be the same as the module to be the same as the one your text will call when it is pressed.
  5. Update the getsheetobject("****") to be the object name of your list box.

Note: you can uncomment the msgbox lines to use for testing.

Code:

sub AccountPathRefresh

'msgbox "start"

    set vObject = ActiveDocument.GetSheetObject("LB02")

    set vChange=vObject.GetProperties

    vChange.Layout.ShowAsTreeView = false

    vObject.setproperties vChange

    vChange.Layout.ShowAsTreeView = true

    vObject.setproperties vChange

   

'msgbox "finished"

end sub

Not applicable
Author

Do do Left join and keep the Path field in another table.

I am not sure the delimiter is '-' not '~'

In the List box Try with '-' as delimiter

gerrycastellino
Creator III
Creator III

Hi dathu:

I'm interested in your solution to the sorting on the tree,  can you explain some more.

Gerry