Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

faisalaaa
New Contributor II

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
Valued Contributor

Re: How to sort date in a chart?

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')

16 Replies

Re: How to sort date in a chart?

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

MVP
MVP

Re: How to sort date in a chart?

Go to Sort Tab

Write Below in your Expression

Date#(date,'MMM-YY')

faisalaaa
New Contributor II

Re: How to sort date in a chart?

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 !

MVP
MVP

Re: How to sort date in a chart?

Try

Date#(YearMonth,'MMM-YY')

Re: How to sort date in a chart?

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


faisalaaa
New Contributor II

Re: How to sort date in a chart?

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

Re: How to sort date in a chart?

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

faisalaaa
New Contributor II

Re: How to sort date in a chart?

Did not work.

Your steps are Not clear .

Kindly explain in more detailed steps.Thanks


qv_testing
Valued Contributor

Re: How to sort date in a chart?

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')

Community Browser