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

Sorting a List Box

Hello

I have a list box. The dimension in that List Box is Period Name. It has the values as SEP,JAN,MAR,JUN,FEB........

How do I sort it to show JAN,FEB,MAR,APR,MAY....................DEC.

What is the best setting that I should do in my sort tab to fix this.

Thanks

14 Replies
nizamsha
Specialist II
Specialist II

usaully its predefiend  like this

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

for some reason u r not getting ur month column in sorting order in listbox sort option is there u can sort ascending or descending

even u r not getting mean use dual

when we r calculating in backend i use to go for dual

in front end if i want to sort based on weight mean i will go for rank

if(Month='Jan',Dual('Jan',1),

if(Month='Feb',Dual('Feb',2),

if(Month='Mar',Dual('Mar',3),

if(Month='Apr',Dual('Apr',4),

if(Month='May',Dual('May',5),

if(Month='Jun',Dual('Jun',6),

if(Month='Jul',Dual('Jul',7),

if(Month='Aug',Dual('Aug',8),

if(Month='Sep',Dual('Sep',9),

if(Month='Oct',Dual('Oct',10),

if(Month='Nov',Dual('Nov',11),

if(Month='Dec',Dual('Dec',11))))))))))))) as Month

its_anandrjs

Hi Rizwan,

Your sorting problem identify let me know

Thanks & Regards

preminqlik
Specialist II
Specialist II

Hi there,

go to expression and write the below expression...make sure remaining check boxes are unchecked

only({1}num(Month(Date#(capitalize(left(FieldName,3)),'MMM'))))

Hope this helps

Not applicable
Author

Hi,

Try dual in script say for eg

month:

load * inline [

Month

April

August

Feburary

December

January

July

June

March

May

November

September

October

];

Month_New:

LOAD DUAL(Month, New_Month) as [new_mon] inline

[Month,New_Month

April,APR

August,AUG

Feburary,FEB

December,DEC

January,JAN

July,JUL

June,JUN

March,MAR

May,MAY

November,NOV

September,SEP

October,OCT

];

Month_Num_rep:

load dual(New_Month, num) as [Month_orderd] inline

[New_Month, num

JAN,1

FEB,2

MAR,3

APR,4

May,5

JUN,6

JUL,7

AUG,8

SEP,9

OCT,10

NOV,11

DEC,12

];

Not applicable
Author

Thanks

This works

On Thu, Apr 3, 2014 at 11:40 AM, Prem Kumar Thangallapally <