Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gkcchowdary
Contributor

how to arrange the dates in order?

Hi

I have moth field data like

Month:

Jun-2016

Jan2016

Feb-2008

Dec2008

Mar-2017

Apr-2018

Nov-2017

Jan-2007

Feb-2007

Dec-2016

Aug-2018

Nov-2008

I am creating chart and calculate the rolling 12 months and I am using above month field in a dimension.

problem is my dimension not showing order. I want display the month field in proper order.first2018 and 2017 ...

like  Aug-2018 Apr-2018  Nov-2017  Mar-2017  Dec-2016 Jun-2016  Jan2016  Dec2008  Nov-2008  Feb-2008  Feb-2007 Jan-2007

How to do this. Please help on this.

thanks.

3 Replies
arvind_patil
Valued Contributor II

Re: how to arrange the dates in order?

HI chaitanya ,

Also firstly convert them into date format and try to sort.

Date(monthstart(Date#(month,'MMM-YYYY'))) as Date

Please create master calendar and Sort it in as you wish.

Thanks,

Arvind Patil

gkcchowdary
Contributor

Re: how to arrange the dates in order?

I am using rolling 12 months exp

count({<[Event Category]={'Near Miss'},maxdate1={">=$(=MonthStart(AddMonths(Max(maxdate1)),-12),'MMM/YYYY')<=(=MonthEnd(Max(maxdate1))),'MMM/YYYY')"}>}DISTINCT [Event ID])

date(Date#([Reporting Period],'MMM-YYYY'),'MMM/YYYY')as maxdate1

Reporing Period Is my month filed.

is there any wrong in above script.i got the sorting but I am missing some months.

actuvally in 2018  I have jun may apr mar but in my chart showing only may 2018 and remaing 2017 and 2016 it showing exact sorting. 

arunaerra
Contributor

Re: how to arrange the dates in order?

hi,

use the below sort expression

MonthName(Date#(month, 'MMM-YYYY'))date.PNG

Community Browser