Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

How to sort list box with an expression

I have a list box that has some blanks in it, so I used an expression to remove them.  Upon doing so, the sort no longer works as it did previously.  I want to sort ascending.  I tried changing the sort from State - Auto Ascending to Expression - Ascending and then placing the expression in the box below, but it does not seem to work.  Here is the expression I am using:

=If(Len(Buyer)>0,Buyer)

13 Replies
sunny_talwar

Try this:

=If(Len(trim(PurgeChar(Buyer, Chr(48))))>0, Buyer)

cliff_clayman
Creator II
Creator II
Author

What does that do exactly?

sunny_talwar

There are two types of blanks.... one is normal blank and the other one is some sort of character which seems to be Chr(48).... I purged it while checking for blanks

cliff_clayman
Creator II
Creator II
Author

Great, thanks again!!!