Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

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
Highlighted
Creator III
Creator III

Re: Months not sorting in Line Chart

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

8 Replies
Highlighted
Champion III
Champion III

Re: Months not sorting in Line Chart

Do you have a date field in your calendar?

Highlighted
Creator III
Creator III

Re: Months not sorting in Line Chart

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

Highlighted
Master II
Master II

Re: Months not sorting in Line Chart

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

Capture.JPG

Highlighted
Creator III
Creator III

Re: Months not sorting in Line Chart

Hi Arjun.

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

Highlighted
Creator III
Creator III

Re: Months not sorting in Line Chart

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

Highlighted

Re: Months not sorting in Line Chart

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Creator III
Creator III

Re: Months not sorting in Line Chart

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?

Highlighted
Champion III
Champion III

Re: Months not sorting in Line Chart

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

= Min({1}MonthName(YourDateField))