Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ahmar811
Creator III
Creator 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

1 Solution

Accepted Solutions
ahmar811
Creator III
Creator III
Author

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

Thanks & Regards

View solution in original post

7 Replies
prasadcm
Creator II
Creator II

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

marcus_sommer

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

- Marcus

qlikview979
Specialist
Specialist

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

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.

sunny_talwar

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

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
Creator III
Creator III
Author

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

Thanks & Regards