Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Listbox Expression sort problem

Hi guys,

I've faced a problem trying to sort values in a listbox populated by the expression:

=if(EntryType = 'PR',
Project,
null()
)



The sort rule is:

State = "Auto Ascending"
Text = "A->Z"

Whenever any value from other fields is selected, the values of the listbox remain on their places although the possible values should be displayed first according to the sort rule.

The listbox with any field gets sorted perfectly well while it seems that it does not like expressions for sorting.

Are there any ideas how to solve the problem?

Thanks.

Valera



29 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

Ok.. I got your point.

Just tick the State as Ascending and Expression as descending.. its working fine for me..!!!

Anonymous
Not applicable
Author

Haha, Deepak, this is almost unbelievable! 🙂

This does change the situation a bit. But in fact the problem remains:

The sorting problem appears more difficult to reveal. 🙂 But it persists. 🙂

I start thinking the problem is more or less unsolvable. There should be some problem in Qv because I can hardly imagine any string to cause this sorting problem. 🙂

Thanks for your efforts. 🙂

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hello boys,

I informed QlikView Support about this "feature" a year ago in version 8.5 and the answer was:

"...create a field with the expression in the script...."

By the way, you will have the same problem in a multibox.

deepakk
Partner - Specialist III
Partner - Specialist III

Hmmmmmmm.........

Did u make any other selection .... for me its coming fine.

Check the attachment...........!!!

Anonymous
Not applicable
Author

Hi Martina,

I seem to be unable understand your response. A couple of days ago such an answer took place already and I asked for details. With no result.

So could you please explain how to "create a field with the expression in the script"?

That would be greatly appreciated! 🙂

john_duffy
Partner - Creator III
Partner - Creator III

Hi Valera.

Just curious, did you find a solution to this problem?  We are migrating to version 10 SR2 and I am having the same sort issue.  It only occurs in list boxes using expressions.  The sorting works fine in our current version 8.5.

Thanks,

John.

Not applicable
Author

Hi,

If you use an expression with if() statement and then just use in the sort : 1) State - Ascending and Text A->Z it works perfectly fine in v10 sr3.

Not applicable
Author

For the record, this bug remains unfixed in 11 SR1.

Not applicable
Author

I struggled a couple of hours with this crazy problem.

My definitive solution is to solve this issue at the script loading level. (i.e. with a dedicated SortField in your database)

example with an sql select :

SQL select

// here all the fields (SortField included !)

from

// data origin source

order by SortField

you only check the "Load Order"  in your Listbox properties - Sort   and then the selection respect your original order defined in your script.

Hope that could help.

Anonymous
Not applicable
Author

I know this was asked a long time ago, but it seems that you're not the only one who's experiencing problems like this. If I understand your problem correctly, you want to first sort the listbox by possible values of ProjectDesc, then sort it in alphabetical order after that. You also don't want to show certain values based on the expression If(EntryType = 'PR', ProjectDesc).

I was able to solve that problem with the following expression: =Ord(If(EntryType = 'PR', ProjectDesc)). You don't want "State" checked in this case. The Ord function sorts the values by the first letter of the string. Then  select "Text" A to Z to sort based on the subsequent characters.