Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bucket sorting issue

hi all,

I have created one bucket but its sorting is not proper....

How to make it as per my script...

I have attached my sample application...

5 Replies
tresesco
MVP
MVP

Sort by exp:


SubField(PurgeChar(BUCKET,'+'),'-',1)

tamilarasu
Champion
Champion

Hi Akshata,

Your data format is text, so try the below in listbox property

Capture.PNG

Let me know

Kushal_Chawda

best way to do it is using Dual function in script

create your bucket like below

IF( ([Target Completion Date]-[Main Start Date])>=0 AND ([Target Completion Date]-[Main Start Date])<=2, dual('0-2',1) ,

             IF( ([Target Completion Date]-[Main Start Date])>=3 AND ([Target Completion Date]-[Main Start Date])<=5, dual('3-5',2),

                 IF( ([Target Completion Date]-[Main Start Date])>=6 AND ([Target Completion Date]-[Main Start Date])<=10, dual('6-10',3),

                    IF( ([Target Completion Date]-[Main Start Date])>=11 AND ([Target Completion Date]-[Main Start Date])<=15, dual('11-15',4),

                         IF( ([Target Completion Date]-[Main Start Date])>=16 AND ([Target Completion Date]-[Main Start Date])<=20, dual('16-20',5),

                             IF( ([Target Completion Date]-[Main Start Date])>=21 AND ([Target Completion Date]-[Main Start Date])<=25,dual( '21-25',6),

                                 IF( ([Target Completion Date]-[Main Start Date])>=26 AND ([Target Completion Date]-[Main Start Date])<=30,dual( '26-30',7),

                                 IF( ([Target Completion Date]-[Main Start Date])>=31 AND ([Target Completion Date]-[Main Start Date])<=40, dual('31-40',8),        

             dual('40+',9))))))))) AS BUCKET,

            

Now go to properties of list box , go to sort tab, sort it by Numerical value asc or desc

Anonymous
Not applicable
Author

Or you can do something like this:

see the attachment..

buzzy996
Master II
Master II

see tis,

sortorder.PNG