Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart sort orders come out wrong using date dimension

Hi guys. I've built a chart that counts records based on a Fiscal Calendar dimension. So our fiscal year begins on October 1 and ends on September 30. I created a basic chart that uses the Fiscal Month Name as the dimension and Count(DISTINCT FCDateKey) as the expression. The chart looks OK, but the sorting on the dimension is weird. Sepember should be the last month in the list, but instead it's the first. Everything is in the right order except for September. I tried sorting a number of different ways, by date key (YYYYMMDD), the date field itself, numeric, state, etc. and I can't get it to work. Any ideas? I've run into QlikView doing funky things with the sorting in the past where it just doesn't want to listen to me..

Thanks for the help!

Eric

2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

You can add some coding and set the sort order of the months in your calender table. Something like this:

MonthOrder:
LOAD dual(Month, SortOrder) as Month;
LOAD * INLINE [
Month, SortOrder
11, 1
12, 2
1, 3
2, 4
3, 5
4, 6
5, 7
6, 8
7, 9
8, 10
9, 11
10, 12
];

kji
Employee
Employee

Alternatively put this at the beginning of the script and then set sort to use LoadOrder.

LOAD * INLINE [
Month
11
12
1
2
3
4
5
6
7
8
9,
10
];