Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
venkey2847
Contributor II
Contributor II

Sorting problem in multibox

I have a multi box with the values

0employess

1-10 employees

11 - 50 employees

51-100 employees

101-1000 employees

1001 - 10000 employees

If I select 51-100 employees the values should be like above

But it is giving like below

0employess

101 - 1000 employees

11-50 employees

51-100 employees

How can I achieve like above??

Thanks in advance

7 Replies
sunny_talwar

Are you using a field or calculated expression to get this? and make sure that state is unchecked on the sort tab

Capture.PNG

jcs_2015
Contributor III
Contributor III

You could set the sort order in the Object via an Expression.  Be sure to turn off the other potential sort criteria though.

=wildmatch([Dimension Name],'DIM val1', 'DIM val2', 'DIM val3'...)

venkey2847
Contributor II
Contributor II
Author

Hi

I am using field only not calculated expression.

sunny_talwar

Did you try unchecking the tick box next to the State?

johnw
Champion III
Champion III

Define your ranges in script with dual(). For instance:

if(Employees = 0,dual('0 employees',0)
,if(Employees < 10,dual('1-10 employees',1)
,if(Employees < 50,dual('11-50 employees',11)
...))) as [Employees Range]

Then sort numerically.

venkey2847
Contributor II
Contributor II
Author

Hi John,

By using Match function it is giving in correct order but if i make a selection on 11-100 Employees it is not giving an correct order like below

Emprange

11-100 Employees

0 Employees

1-10 Employees

101-500 Employees

501-1000 Employees

10000+ Employees

1001-10000 Employees

But it should not be like above

It should be in sorting order

Help me out this issue

Thanks

johnw
Champion III
Champion III

"Did you try unchecking the tick box next to the State?" - Sunny T

And while match() will give you the correct sort order in any one place, such as in your multi box, you have to repeat the match() expression or use a variable for it in every place you want to sort that way. By using dual() in the script you can just sort in numeric order. Not a big deal, though.