Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
manisha_uit
Creator
Creator

Sort months

Hi everyone,

Can anyone help me to sort months in a proper order.

Thanks

Manisha Choudhary

1 Solution

Accepted Solutions
Sokkorn
Master
Master

Hi Manisha,
Right Click on List Box --> Perperties --> Sort tab --> Check Expression --> Paste this code : =Match(MONTH, $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39)))
Hope this help you.
Note: MONTH is your month field.
Check attached file.
Regards,
Sokkorn

View solution in original post

12 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

The Month() function returns a dual value with the month name as the text and the month number (1-12) as the value. This will sort in calendar order.

LOAD ...

     Month(date) AS Month,

     ...

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
its_anandrjs
Champion III
Champion III

Hi,

Yes when ever you sort the value it is sorted in the proper order by desceding or ascending order but if you want to sort it alphabetical or Numerical value it is sorted in that order by selecting in the sort menu option in properties.

Regards

Anand

Sokkorn
Master
Master

Hi Manisha Choudhary,

Can you explain more on your requirement? Or you can upload your file for more details on your requirement.

Regards,

Sokkorn

its_anandrjs
Champion III
Champion III

Hi,

Please confirm in any object you want to sort the value of months or by fetching the value you want to sort the value.

Regards,

Anand

manisha_uit
Creator
Creator
Author

Hi,

Thanks for your quick responses.

Let me explain what i want to do.

I have a list box containing months which is sorted in alphabetical order.

I want it in proper order as: Jan Feb Mar Apr ......

Thanks

Manisha

its_anandrjs
Champion III
Champion III

Hi.

For sort it in proper order goto

Properties -> Sort -> Check Mark Expression -> select Ascending or Desceding -> or in the below text box type month column field.

By this you can get sorted month in proper order.

Regards

Anand

manisha_uit
Creator
Creator
Author

Hi Anand,

Thanks for your reply.

But this doesn't seem to work correctly.

Any other solution...

Thanks

Manisha

its_anandrjs
Champion III
Champion III

Hi,

Do you have any small sample file if so please provide to me.Or if you sort the moths by expression so only Expression shold be check mark you check this or not. 

Reagrds

Anand

its_anandrjs
Champion III
Champion III

Hi,

Please check you select this or not in the sort menu.

Image.jpg

Reagrds

Anand