Interesting solution, Clever Anjos.
Do you have an explanation for that? Or why it works with an expression in the list box, but not a similar generated field in the script?
Brian Yordnoff wrote:
Curious, has QlikTech spoken on this issue? Is it considered by design or a bug, and, if the latter, do they have a fix date or version in mind?
I don't remember something like that. Sorting seems to be not very well documented (not only text sort, also sort by expression), if not to say documentation is wrong at that text sort place (depending on how you read 'Sorts the field values in alphabetical order.')
But I believe the general text sort behaviour is considered by QT as working as designed, though I think what Clever Anjos used is eventually a bug (though it serves your request).
The more you try to understand the QV sort options, the more confused you get...
swuehl, I really don´t understand why it works using an expression into listbox and not into script.
As you, I´m confused why it works this way.
Maybe I´ve used a bug against another bug
Clever Anjos suggested to use a list box field expression, not a sort by expression.
Surprisingly, this seems to work (though I wouldn't be surprised if it's not working on all versions / platforms).
I tried this, but no luck. It still selects the entries in place. It does not move them to the top. If I remove the expression, the selected entries move to the top of the list.
Even so, the replacement of field with expression causes a performance hit. It takes several seconds to re-sort the listbox anytime a selection is made. Also, I'm noticing other inconsistent behavior with it -- mainly on reload. In theory, it's an interesting idea, but I don't think it's going to work in our production application.
I do appreciate yours and the efforts of everyone here.
I don´t see how can we proceeed.
I was aware that could lead to perfomance issues, since we´re using an expression instead of a 'pure' field.
As I said, that is small 'workaround' ("gambiarra" in Portuguese) to an known issue.