Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sort a list of months in chronological order


Hello everyone,

I am trying to order a list of months in chronological order (January, February, March, etc), not in alphabetical order as shown below:

Months.JPG

Anyone knows how i can do that?

Regards

1 Solution

Accepted Solutions
crystles
Partner - Creator III
Partner - Creator III

If they are listed in the script as you want them, then just select "Load Order" under the sorting tab in the properties menu.

OR if you want to do it manually, Just put this code in the Expression section, under the sorting tab.

avg({1}match(MonthField, 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'))

View solution in original post

6 Replies
sunny_talwar

How are you creating it in the script? Using Month() function or not? If you are, then you just need to sort them in Numerical Ascending order. If you are not then use a sort expression like this:

=Date#(MonthFieldName, 'MMMM')

swuehl
MVP
MVP

Use a dual value when creating the field values (either by using the QV date and time functions, or using DUAL()).

Then your list of months will be sorted correctly by default (using numeric sort).

crystles
Partner - Creator III
Partner - Creator III

If they are listed in the script as you want them, then just select "Load Order" under the sorting tab in the properties menu.

OR if you want to do it manually, Just put this code in the Expression section, under the sorting tab.

avg({1}match(MonthField, 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'))

Not applicable
Author

Hi Sunny Talwar,

I am not using the Month() function.

Actually, months are in a column of my data base, so it is a field called "Month".

Thanks

Not applicable
Author

Thanks Crystles, your tip solve my problem.

Have a nice weekend

crystles
Partner - Creator III
Partner - Creator III

Awesome! I'm glad it worked for you!

Hope you have a nice weekend too!