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

how to sort month by order?

hi to all,

Anyone of you explain how to sort the month by order.

My month dimension like below

month:

Apr

Aug

Jul

Jun

Sep

Oct

Nov

Mar

May

Jan

Feb

But I want month list like

Month

Jan

Feb

Mar

Apr

May

Jun

Jul

Aug

Sep

Nov

Dec

20 Replies
ecolomer
Master II
Master II

if the field have a date format, order are automaticly good as Num(Month)

Can you upload more explicity your problem?

To sort by Month (numeric) is necesary to have date format

jonathandienst
Partner - Champion III
Partner - Champion III

That's because your month is a text field. Convert it to a proper month field during load. The month field is a dual with the month number as a value and a text representation of the 3 character month name.

LOAD...

     Month As MonthText,   // do you need this field?

     Month(Date#(Month & '2015', 'MMMYYYY')) As Month,

(the year used is irrelevant)

This month field should be sorted numerically (as is usual for dual values)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tresesco
MVP
MVP

Sort expression: =Month(Date#(month,'MMM'))

PFA

prajapatiamar38
Creator II
Creator II

Hi try this

LOAD * INLINE [

Month,Month_NO

Apr,4

Aug,8

Jul,7

Jun,6

Sep,9

Oct,10

Nov,11

Dec,12

Mar,3

May,5

Jan,1

Feb,2

];

Then in list box of Month Go to Sort Tab>Expression write the Month_NO

Thanks And Regards

Amarnath

krishna20
Specialist II
Specialist II

Hi,

Please find the attachment.

Edit

month:

LOAD Month(Date#(Month,'MMM')) as month

INLINE [

Month,

Apr

Aug

Jul

Jun

Sep

Oct

Nov

Mar

May

Jan

Feb

];

MarcoWedel

Hi,

for the

Month(Date#(month,'MMM'))


approach (best done in the script) you might have to adjust your MonthNames variable to


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

if that's not your local default.

regards

Marco

sunilkumarqv
Specialist II
Specialist II

Copy the script and use Sortvalue descending in sort expression.

Load *, INLINE [

Month,Sortvalue

Apr,4

Aug,8

Jul,7

Jun,6

Sep,9

Oct,10

Nov,11

Dec,12

Mar,3

May,5

Jan,1

Feb,2

];

kavita25
Partner - Specialist
Partner - Specialist

In Sort Tab, under expression:

wildmatch(Month_field,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')

mohammadkhatimi
Partner - Specialist
Partner - Specialist

=wildmatch(capitalize(only({1}CalMonth)),'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC')



Hope this will helps you..!!

Regards,

Mohammad