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

MonthName - How to sort by January --> December

Hi folks,

How do I manually sort the month selection tab to show the order of months the right way. Please view the image below for further clarification:

MonthProb.jpg

Please advise. Thanks in advance.

Best Regards,

R

1 Solution

Accepted Solutions
its_anandrjs

If you want to sort the months manually then use match function like

=Match(Yourmonthfield,'December','February','January','May')

and type this code in the Expression tab.

View solution in original post

7 Replies
its_anandrjs

use sort sequence for that like

Load * inline

[

Month, SeqOrder

December, 1

February, 2

January, 3

May, 4

];

and in list box month uncheck all and then select expression and type SeqOrder there

Not applicable
Author

Goto the Sort Tab of the chart or list box. Click on the Expression. Write something like this

Match(<your month field>,'December','February','January','May)

its_anandrjs

If you want to sort the months manually then use match function like

=Match(Yourmonthfield,'December','February','January','May')

and type this code in the Expression tab.

Not applicable
Author

Go to the sort tab, remove all existing sorting and add this "month(date#(Mon,'MMM'))" where "Mon" is the name of your field.

Thanks,

Jyotsna

jagan
Luminary Alumni
Luminary Alumni

Hi Ram,

In load script arrive a new month field like below, and in Sort tab of chart properties -> Number -> Select Ascending/descending based on your requirement.

TableName:

LOAD

*,

Date(DateDimensionName, 'MMMM')

FROM DataSource;

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi Ram,

I think doing this script is better option then using Match() in Sort tab, because wherever you are using Month as dimension there you need to give this.  It is difficult to handle if you are using Month in multiple charts/listboxes.

Regards,

Jagan.

Not applicable
Author

Hi,

Use this expression in Sort tab for sorting the month names as you like

 

=Only({1} Match(Month,'Janaury','Febraury','March','April','May','June','July','August','September','October','November','December'))

Note: Please change the months in the expression as per your requred sort order.

Hope it heps you..