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

Chronologically Sorting

Hello!

I have a bar chart where the X axis uses the field PERIOD which has the following date format: YYYY/MMM

For example:

  • 2013/jun
  • 2013/aug
  • 2014/feb

I want to sort the X axis chronologically (first order by year and then by month: january, february, march...), but I couldn't do it so far.

In order to build the PERIOD field, I used: YEAR (DATE) & '/' & MONTH (DATE).

How could I do this?

Thank you!!!

1 Solution

Accepted Solutions
Not applicable
Author

in the sort expression you provide this and say Ascending.

Date#(PERIOD,'YYYY/MMM')

View solution in original post

4 Replies
Not applicable
Author

in the sort expression you provide this and say Ascending.

Date#(PERIOD,'YYYY/MMM')

Anonymous
Not applicable
Author

Use monthname(Date) which will give you year month in numeric format.

Then it will easily sort out.

moreover you can also use

OR you can also use

date#(makedate(year(Date),month(Date),1),'YYYY/MMM')

tresesco
MVP
MVP

Nitin, Your second expression should be using Date() instead of Date#().

Anonymous
Not applicable
Author

Right....