Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
valera_sh
Creator II
Creator II

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
Partner

Just Change the State = "Auto Ascending" to

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

valera_sh
Creator II
Creator II
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
Partner

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

valera_sh
Creator II
Creator II
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
Partner

I think i Got it...!!!

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

valera_sh
Creator II
Creator II
Author

Yep! 🙂 Indeed, this seems to work!

Thanks! 🙂

valera_sh
Creator II
Creator II
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
Partner

hi,

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

eg :

=if(EntryType = 'PR',
Project
)

valera_sh
Creator II
Creator II
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... 😐