Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List Box bug? Sort by Expression not working when Treeview is selected

Has anyone else experienced this issue: When I use a List Box with Treeview enabled, and then attempt to sort by an expression (in my case just a single field), the sorting doesn't consistently work at all levels.

The weird thing is that depending on other circumstances it sometimes works and sometimes does not work. Sometimes encapsulating the sort field in "Max()" works, depending on the hierarchy.

To give you some more info, the Path field I'm using was constructed using the "hierarchy" command in the load script, and everything displays correctly (as a tip for using Treeview: be sure to choose a delimiter character that is guaranteed not to show up in the path nodes [e.g. '~']).

Could I be doing something wrong, or is this a legitimate bug?

2 Replies
Not applicable
Author

I've found a workaround to this bug.

Namely, just load the records in the order you desire (e.g. ...ORDER BY list_order) , and then sort by load order within the List Box control. This sorts the list correctly, even when in Tree-View mode.

Workaround trade-offs:

The drawback to this approach is that you're beholden to a single sort order for the path in question.

The advantage is that you can leave the sort order field out of your data model, thereby simplifying it and saving on memory.

Not applicable
Author

I agree that the biggest drawback to this approach is the single sort order.

Check out the following discussion for an example of the issue, and hopefully a resolution.

http://community.qlik.com/thread/39294?tstart=0