Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ZoeM
Specialist
Specialist

Months not sorting in Line Chart

Hi Community.

Several of my charts that are using months (Jan - Dec) as x-axis are not sorting as they should, all the charts are pulling Nov and Dec as starting months followed by Jan through Oct. This is a weird little scenario and I have tried going back to older versions of the dashboard but so much has changed from previous versions that it would be more worthwhile to try and figure out what it is.

No changes were made to the Master Calendar so not sure why this would be happening. Sorting under Chart Properties does not affect it. Im just dumb founded.

Has anybody experienced this and what kind of solutions have you found?

Thanks.

1 Solution

Accepted Solutions
ZoeM
Specialist
Specialist
Author

I have found a workaround where I force the chart to sort by using an expression, weird that before I never had to do that and I do not like the fact that this is a temporal fix. I still do not understand why it stopped recognizing my date fields as dates.

Match([Month of Year Abbreviated Name],'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')

View solution in original post

9 Replies
vishsaggi
Champion III
Champion III

Do you have a date field in your calendar?

ZoeM
Specialist
Specialist
Author

Yes I do.

Charts where I am using YearMonth as a dimension have no issue.

Charts where I am using Month as Abbreviated Name and Year are not sorting as desired.

All these fields are coming through the Master Calendar and Date bridge

qlikviewwizard
Master II
Master II

Disable other Dimension's sort and do sort on YearMonth like below.

Capture.JPG

ZoeM
Specialist
Specialist
Author

Hi Arjun.

I tried that too and my order is still Nov, Dec, Jan, Feb...Oct.

ZoeM
Specialist
Specialist
Author

I have found a workaround where I force the chart to sort by using an expression, weird that before I never had to do that and I do not like the fact that this is a temporal fix. I still do not understand why it stopped recognizing my date fields as dates.

Match([Month of Year Abbreviated Name],'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')

Anil_Babu_Samineni

Instead create field in script and enable expression from sort tab and use Month_Num instead of static

Num(Month(Date#([Month of Year Abbreviated Name],'MMM'))) as Month_Num

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ZoeM
Specialist
Specialist
Author

Do you mean creating this in the Master Calendar?

The Main Script is ever evolving because we are adding additional data points to our dashboard and so I do not think it would be of benefit to add it in Script?

vishsaggi
Champion III
Champion III

Or you can simply use below in your sort tab - Expression

= Min({1}MonthName(YourDateField))

Qlik1_User1
Specialist
Specialist

@vishsaggi Can you please help what this expression will do
Min({1}MonthName(YourDateField))