Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting by Month with 3 characters

Fiscal Year is from October through September.

I rearranged the order of the month names with

MonthNames='Oct;Nov;Dec;Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep';

However, I can't get them ordered on the X axis properly.  The order is in reverse.

I tried the Dort Dimensions but could not get the sort order to change. . .

Any suggestions??

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

or try this in chart Properties -> Sort-> Expression

=Match(Month, 'Oct', 'Nov' , 'Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep')


Hope this helps you.


Regards,

Jagan.

View solution in original post

17 Replies
jpapador
Partner - Specialist
Partner - Specialist

In the chart properties go to the sort tab.  Choose month and sort by the following expression:

Match(Month, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov' , 'Dec')

Not applicable
Author

Can u attach the example?

Anonymous
Not applicable
Author

Thomas,

It's not a good idea to use MonthNames in this way.  I suspect that it simply renames Jan to Oct, Feb to Nov,  etc..

You rather have to create fiscal year which starts in October and ends in September.

As for the sorting, looks like you're using "descending" (?)

Regards,

Michael

Edit:  example how to create month correctly:

dual(month(DateID), if(month(DateID)>=10, month(DateID)-9, month(DateID)+3)) as FiscalMonth

It will have Oct as 1, Sep as 12 when you sort by number

Not applicable
Author

didn't work. . . thanks for the suggestion though.

Not applicable
Author

sorting is tried both ways, no change, though the order is correct, just backwards. . . .

How do I create a fiscal year which starts in October and ends in sep?  do tell!

thanks for the suggestion

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try using like this

LOAD * INLINE [

Month, SortOrder

Oct,1

Nov,2

Dec,3

Jan,4

'

'

'

'

Aug,12 ];

Now use SortOrder in Properties -> Sort -> Expression -> =SortOrder select Ascending/Descending as required.

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

or try this in chart Properties -> Sort-> Expression

=Match(Month, 'Oct', 'Nov' , 'Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep')


Hope this helps you.


Regards,

Jagan.

Anonymous
Not applicable
Author

Just edited my post with the example for the fiscal months

Jagan's way is usable as well, except you get an additonal filed (wich I prefer to avoid)

Not applicable
Author

all great suggestions, so far no go on any of them. .