Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Sort Month and Year in Order


My file is loaded in this order(MMM YYYY) for 2010 and 2011. How do I sort this in order?  Also, when I select 2010/2011 all the months start jumping around in my graphs.

APR 2010   MAY 2010

APR 2011   MAY 2011

AUG 2010

AUG 2011

JAN 2010

JAN 2011

Thanks for the help!

Tags (1)
5 Replies
Honored Contributor

Sort Month and Year in Order

Hi samantham,

Any small application then would be understand well on your issue. If have any attachment then it would be easy to find solution.


Sokkorn Cheav

New Contributor III

Sort Month and Year in Order

Dear Samantham

its better to find use function monthname(order#(Apr 2011,'MMM YYYY')) and then sort it into Ascending or descending

by ticking on the numeric sort in sort tab

do let me know wether it worked

else u can also use

Exp num(makedate( year(order#(Apr 2011,'MMM YYYY')),Month(order#(Apr 2011,'MMM YYYY')),01))

in ur sort tab it will solve ur problem

do let me know wether it worked



Valued Contributor

Sort Month and Year in Order

Hi Samantham the problem with your output is that ...you are getting the date as String format not as the date format.

So you are getting the desired result.First get the date in no format. for example for the field

Orderdate it may be----date(orderdate,'DD/MM/YYYY') as orderdate1

then fin the


then make a variable $MinDate using the peek function

date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY') AS MonthYear.

This will give you the required result.

Hope this will help you.

If any further query than give the attached copy of your application



Honored Contributor

Re: Sort Month and Year in Order

Hi samantham,

Right Click on Chart ==> Sort tab ==> Select on Dimension ==> Check on Expression and past this Match(CAPITALIZE(LEFT(TRIM(Months),3)), $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))) + (RIGHT(TRIM(Months),4) * 10)

See the attached file also.

Note: Months is the field in format (MMM YYYY).

HTH and let me know.


Sokkorn Cheav

Not applicable

Re: Sort Month and Year in Order

Hi ,

Can you help be modify our expression if the Month is in the format MMM-YY?



Community Browser