Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

ahmar811
Contributor III

Date Sorting issue

Hi

experts,

i have date field in MMM YY format.

i want to sort my bar chart to the specific order like below.

    MTD          MTD-1          MTD-2      [last Year MTD]

June 2016     May 2016     Apr 2016     June 2015

Capture.PNG

please find attached sample file for your reference.

Thanks & Regards

Ahmar Ansari

Tags (2)
1 Solution

Accepted Solutions
ahmar811
Contributor III

Re: Date Sorting issue

Thank you friends for your support.i just solved the issue from load script by using order by.

Thanks & Regards

7 Replies
prasadcm
Contributor II

Re: Date Sorting issue

Try to just check the Load Order->Reversed in Sort Tab,uncheck every other option in sort tab.

Re: Date Sorting issue

Quite often worked a sorting-expression like: avg(Date) for it (if those yearmonth-field is related to a date).

- Marcus

qlikview979
Valued Contributor

Re: Date Sorting issue

Hi

please find the attached file

Try like this

Write this in sort tab

if(FMonthYear2='Apr 17',1,if(FMonthYear2='Mar 16',2,if(FMonthYear2='Feb 16',3,if(FMonthYear2='Apr 16',4))))

Regards,

Mahesh

Not applicable

Re: Date Sorting issue

Hi Ahmar,

In sort bt expression use below expression:

=MATCH(MAX(mAKEDATE(FiscalYear,FiscalMonth)),MAX(MAKEDATE(FiscalYear,FiscalMonth))-1,MAX(MAKEDATE(FiscalYear,FiscalMonth))-2)

Find attached app. Its working as per your sort requirement.

Re: Date Sorting issue

How about this?

Sum({<FMonthYear2 = {"$(='>=' & Date(MonthStart(Max(FMonthYear2), 0), 'MMM YY') & '<=' & Date(MonthEnd(Max(FMonthYear2), 0), 'MMM YY'))",

  "$(='>=' & Date(MonthStart(Max(FMonthYear2), -1), 'MMM YY') & '<=' & Date(MonthEnd(Max(FMonthYear2), -1), 'MMM YY'))",

  "$(='>=' & Date(MonthStart(Max(FMonthYear2), -2), 'MMM YY') & '<=' & Date(MonthEnd(Max(FMonthYear2), -2), 'MMM YY'))",

  "$(='>=' & Date(AddYears(MonthStart(Max(FMonthYear2), 0), -1), 'MMM YY') & '<=' & Date(AddYears(MonthEnd(Max(FMonthYear2), 0), -1), 'MMM YY'))"}

,FiscalMonth, FiscalYear>}Value)


Capture.PNG

Not applicable

Re: Date Sorting issue

Just another Approach...

why not switching the format from MMMM YY to YY/MMMM ?

(e.g. by  right(DateField,2)&'/'&left(Datefield,4), or if you have the date you can insert it in the Date() function).

it will sort your Charts automatically without too sophisticated formulas...

ahmar811
Contributor III

Re: Date Sorting issue

Thank you friends for your support.i just solved the issue from load script by using order by.

Thanks & Regards

Community Browser