Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting Values In a List Box

Hi all,

I have another thing I am stuck with!!!

I am creating a qlikview report for records returned within a certain period. I am using a standard SQL smalldatetime field named 'DateReturned' and would like to create a new list box which shows this data grouped into the year and month, for example, the values 03/03/2010 and 02/03/2010 I would like to appear as 'March 2010' (or something similar).

I would like to also be able to sort this list box in descending order so that it keeps the sorting integrity of the dates, for example the first six values in this list box would be:

March 2010

February 2010

January 2010

December 2009

November 2009

October 2009

Can anyone help?

Thanks in advance,

Chris

1 Solution

Accepted Solutions
pbaenen
Contributor III
Contributor III

Yes, you can either add this to your script:

Date(MakeDate(Year(DateReturned), Month(DateReturned)), 'MMM-YYYY') as MonthYearFormatted

Or you can use that as a Calculated Dimension in a chart if you want to see what it looks like without reloading.

View solution in original post

4 Replies
pbaenen
Contributor III
Contributor III

Are you using a Calendar in your application? Because if you are, you can add a field that just holds the first day of the month for each date, and you can use that in your application. In my calendar file, I put:

Date(MakeDate(Year(Date), Month(Date)), 'MMM-YYYY') as MonthYearFormatted

Not applicable
Author

Hi Paul,

I don't have a calendar in my application as I have forgot how to create one! I went on a course 3 years ago and have only just been given the opportunity to use the application!!

Any ideas on how to create the calendar off my field named DateReturned?

Thanks,

Chris

Miguel_Angel_Baeyens

Hello Chris,

Check among many others this post of today. There are a lot of good examples on how to make a calendar and some tips to customize it.

pbaenen
Contributor III
Contributor III

Yes, you can either add this to your script:

Date(MakeDate(Year(DateReturned), Month(DateReturned)), 'MMM-YYYY') as MonthYearFormatted

Or you can use that as a Calculated Dimension in a chart if you want to see what it looks like without reloading.