Jump to content
We've recently updated our Privacy Statement, available here ×

How to sort the month in ascending order by month?


cheapwebhoster

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

By the way i've found there is monthnumber field which can sort this out however it is in the form of numbers like 1,2,3,4,5..... how can i use this as the sorting order for the month name without putting it together into the table ....i am trying to create a measure in the ireport designer as below but no success

monthname("Day Date") order by MonthNumber("Day Date") <---------- the order by statement seems to be invalid any can tell me what is the statement for that?

 

Link to comment
Share on other sites

I have concatenate the MonthNumber and MonthName like so Concatenate("MonthNumber", '-', "MonthName"). This will do the trick as you can see below the month arrange correctly because the monthnumber is helping...but i dont want the month number to show. You can see 11-November, 12-December which is sucks

/sites/default/files/images/Concatenate.jpg

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

I am also facing the same problem. I have some data with months and years as columns. In mysql qeury i can see data is sorted

but when i see attach the same query and make set and then when i use this set in Ad hoc view i can see the order is chagned on charts/table/cross-tab

not sure why jasper is messing with sorting order. Although i can see i have selected option "Don't sort". Still facing issue.

Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...

It's truly amazing there is not a simple solution to this. We use FileMaker internally and I can easily add a custom sort option that allows us to sort anything anyway we want. In this case, all I have to do is sort based on a pre-sorted list. And, sorting follows the order of the list.

Is there any decent work-around or solution for this issue? We use media months (first Monday of the month to last Sunday of the month) to define our months. So, we have to use custom calculated month fields. Sure would be nice to sort them!

Link to comment
Share on other sites

  • 6 months later...

Do let me know if this works:

CaseRange(MonthNumber("Date Start"), 1, Concatenate('           ', 'January'),
2, Concatenate('          ', 'February'),
3, Concatenate('         ', 'March'),
4, Concatenate('        ', 'April'),
5, Concatenate('       ', 'May'),
6, Concatenate('      ', 'June'),
7, Concatenate('     ', 'July'),
8, Concatenate('    ', 'August'),
9, Concatenate('   ', 'September'),
10, Concatenate('  ', 'October'),
11, Concatenate(' ', 'November'),
Concatenate('December'))

Link to comment
Share on other sites

Do let me know if this works:

CaseRange(MonthNumber("Date Start"), 1, Concatenate('           ', 'January'),
2, Concatenate('          ', 'February'),
3, Concatenate('         ', 'March'),
4, Concatenate('        ', 'April'),
5, Concatenate('       ', 'May'),
6, Concatenate('      ', 'June'),
7, Concatenate('     ', 'July'),
8, Concatenate('    ', 'August'),
9, Concatenate('   ', 'September'),
10, Concatenate('  ', 'October'),
11, Concatenate(' ', 'November'),
Concatenate('December'))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...