Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month ordering in List Box and Line Chart

Hi

I have two fields for a month, one is the month name and the other is MonthNum

Most of our Clients would have monthNum = 1 for July, 2 for August through to 12 for June.

How would I order the values in a list box  and in my line chart dimension. I gather I would need to do it in Sort-Expression but I cannot get the correct code

1 Solution

Accepted Solutions
Kushal_Chawda

write below expression in sort tab

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

View solution in original post

7 Replies
Kushal_Chawda

write below expression in sort tab

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

Chanty4u
MVP
MVP

set monthnum='jul',1;

avinashelite

According to me you could create a Master calendar with normal and finical dates according to the need and you can utilize the same for sorting or other purpose . 

Not applicable
Author

Sorry no, already have it in my code, not sure how the sorting issue would change. Kush's answer works like a dream

swuehl
MVP
MVP

Have you tried sort by an expression on sort tab:

=MonthNum

Deselect the other options for now.

I assume MonthNum is linked to your month name field. If you create your month name field like

LOAD *,    

          Dual(MonthName, MonthNum) as NewMonthField;

LOAD MonthName,

          MonthNum,

         ...

You can just sort all charts / list boxes by sort option 'numeric'.

Not applicable
Author

Long term needs I might look at that, That though is still a long way off at this stage. Thanks for the hint though

Not applicable
Author

I tried the first option, will have a look at the Dual statement. I cannot hard code it through. some clients have July as first month of the financial year, other may have other months, so I bring it through in my sql select as two different fields.

I will have a look through, as I read it again I think it may work as well