Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to sort date in a chart?

Hi

I have a line chart in my dashboard, it contains date like Jan-11,Feb-10.....

I am not able to sort the dates. I want the dates to be look like Dec - 12, Jan - 13, Feb - 13,.............

Thanks,

1 Solution

Accepted Solutions
qv_testing
Specialist II
Specialist II

HI Faisal,

In sort tab you can promote to first your YearMonth field..

then apply in your Expression

Try...

Date#(date,'MMM-YY')

or

Date#(MonthYear,'MMM-YY')

View solution in original post

16 Replies
its_anandrjs

Hi,

In sort option write

MonthName(Datefield)

Or if you have Monthname field use that remove any sort option from sort option

Sort.png

Regards

Anand

MK_QSL
MVP
MVP

Go to Sort Tab

Write Below in your Expression

Date#(date,'MMM-YY')

Anonymous
Not applicable
Author

Thanks Anand & Manish.

Both ways did not work, it is sorting but not in order.

Note, my YeatMonth data  in Excel ( Dec - 12 ), ( Jan - 13 ), .............  are in text format !

MK_QSL
MVP
MVP

Try

Date#(YearMonth,'MMM-YY')

its_anandrjs

Then try this way

=Date#(date,'MMM - YY') //in sort order or remove all other sort option if selected


But if possible make another in the load script as


Load

     MonthName(Date) as MonthYear

From Location;


Regards

Anand


Anonymous
Not applicable
Author

Thanks Anand, but your explanation is not so clear for me, could you explain further!

I have applied your steps, did not work!

CaptureLoad.PNGCapture11.PNG

its_anandrjs

Hi,

I suggested for particular field not for all rows and for that field you have in the data model

MonthName(date) as MonthYear


Or


Date#(date,'MMM - YY') as MonthYear


To convert MonthYear to proper date field is important if you use it as sorting you can do this in front end also but there you may get performance issue.


Regards

Anand

Anonymous
Not applicable
Author

Did not work.

Your steps are Not clear .

Kindly explain in more detailed steps.Thanks


qv_testing
Specialist II
Specialist II

HI Faisal,

In sort tab you can promote to first your YearMonth field..

then apply in your Expression

Try...

Date#(date,'MMM-YY')

or

Date#(MonthYear,'MMM-YY')