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: 
Not applicable

custom sort on an expression listbox

Hi All,

I have a listbox based on an expression like the following :

=if(aggr(sum(Amount),CustomerCode)<50, '<50', if(aggr(sum(Amount),CustomerCode)<500, '50-500', if(aggr(sum(Amount),CustomerCode)>500, '>500')))

The listbox is working but I have 2 problems :

1) I cant sort by the good order :

  • <50
  • 50-500
  • >500

2) when I select a value from this listbox, the 2 non selected values disappear.

Do you know how to solve these issues pls ?

Regards

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

For

#2) add a set modifier to cancel out the CustomerCode selection:

=if(aggr(sum( {$<CustomerCode=>} Amount),CustomerCode)<50, '<50', if(aggr(sum( {$<CustomerCode=>} Amount),CustomerCode)<500, '50-500', if(aggr(sum( {$<CustomerCode=>} Amount),CustomerCode)>500, '>500')))

View solution in original post

3 Replies
maxgro
MVP
MVP

1)

use dual

dual('<50',1)   instead of <50

dual('50-500',2)

....

and sort by number

JonnyPoole
Former Employee
Former Employee

For

#2) add a set modifier to cancel out the CustomerCode selection:

=if(aggr(sum( {$<CustomerCode=>} Amount),CustomerCode)<50, '<50', if(aggr(sum( {$<CustomerCode=>} Amount),CustomerCode)<500, '50-500', if(aggr(sum( {$<CustomerCode=>} Amount),CustomerCode)>500, '>500')))

Not applicable
Author

thank you, works fine