Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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.

Tags (2)
4 Replies
Not applicable

Re: listbox with treeview will not sort properly

Unfortunately selection remains in the same position.

Not applicable

Re: listbox with treeview will not sort properly

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

Re: listbox with treeview will not sort properly

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
Contributor III

Re: listbox with treeview will not sort properly

Hi dathu:

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

Gerry