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

Date sort order in line chart

Hi all, this is driving me crazy :S I've tried everything that came to my mind, I combining 2 years in 1 chart using just month-day as dimension, but I cannot manage to get it sorted correctly, I'm already ordering by date field in load script and sort property in the dimension, but still, the dates not matching. Those at the end happen to be those days that were reported just in one year but not the other, any idea on how to solve this? Thanks in advance!

Dimension: Month([Report Date]) & '-' & Day([Report Date])

Sort: Expression -> [Report date]

I've also tried to create the dimension as text in load script and sort by load order but I'm getting the same result.

Capture.JPG.jpg

25 Replies
Not applicable
Author

I was struggling with the same issue for a while. In my case, 'Sort' was still enabled for one or more Measures. Somehow, Sort on Measure overruled Sort on (time) Dimension. Try disabling Sort for all Measures and see if that helps.

Anonymous
Not applicable
Author

Hi Dennis, thanks for the help, I'll try that next time. What I ended up doing to fix it was creating a new field with this definition in the script to remove the year:

month([Report Date])&'-'&day([Report Date]) as [Report Date 2]

And then sorted ascending by the original [Report Date] in script as well

The dimension then was only sorted by "Load order"

Regards,

Oscar

vikraant
Creator
Creator

I tried this approach, it worked.

Thanks !

Anonymous
Not applicable
Author

Hi Travis, I was facing similar issue and this solved it. I set the dimension to the recommended expression and sorted the dimension alphabetically. Thanks!

james_butler
Contributor III
Contributor III

I encountered a similar problem when combining a period and year.

Using Date#() in the script worked.

I couldn't sort a chart correctly with:

Period & '-' & "Year" as [Period Year]

but this worked

Date#(Period & '-' & "Year",'MM-YYYY') as [Period Year]

Ksrinivasan
Specialist
Specialist

Hi,

its so easy to make it,

Date(MonthStart([Net due dt]), 'MMM-YYYY') set as Dimension, here [Net due dt]=your Date field, then come to Sort and do as shown, you will get.......

clipboard_image_1.png

K. Srinivasan.