Skip to main content
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

Just Change the State = "Auto Ascending" to

State = "Ascending"... It will work Fine.!!

Anonymous
Not applicable
Author

That would be too easy. 🙂

I've already checked all the possible combinations with the STATE option in the sort rule - it seems to be simply ignored.

With any combination of STATE properties I always get the same result:

:
Text = "A -> Z"

State = "AutoAscending", Text = "A -> Z"

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

If I specify just the State option in the sort rule the listbox remains simply unsorted.

Is there a solution for this problem?

Thanks.

Valera

deepakk
Partner - Specialist III
Partner - Specialist III

I am QV SR3 and it is working fine for me. Which version of Qlikview are you using ?

Anonymous
Not applicable
Author

I also use QV SR3.

However, I want to emphasise that the sorting works perfectly fine in a listbox with field name. I needed to exclude some field values and used the expression. And the sorting stopped working! 😞

deepakk
Partner - Specialist III
Partner - Specialist III

I think i Got it...!!!

Just used the same Expression in the Expression tab inside sorting. It seems to be working..!!!

Anonymous
Not applicable
Author

Yep! 🙂 Indeed, this seems to work!

Thanks! 🙂

Anonymous
Not applicable
Author

Well, the primary objective - to put the possible values at the beginning and the excluded values at the end of the list - has been accomplished.

But I see that the sorting itself behaves strangely. This is a "sorted" list:

I can't figure out the reason why the sorting should "restart" when empty string is found! The whole list results split in 2 sorted sublists.

Why can this happen?!

deepakk
Partner - Specialist III
Partner - Specialist III

hi,

Why are you using the null() in the expression any specific reason. Remove it and check

eg :

=if(EntryType = 'PR',
Project
)

Anonymous
Not applicable
Author

I seem not to like implicit values, so prefer explicit definition of the result to be sure to have the values I want. 🙂

In this case, however, there was no specific reason for NULL(), so I removed it. But the resulting "sorted" list remains as it was before - split in two chunks... 😐