Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Sorting Date output in correct order

Hello, I am trying to sort the presentation of a date in the correct order which im struggling with.

I am using the code :- month(Posting_Date)&' '&chr(39)&right(Posting_Date,2) as Posting_Month so that if there is a date of 12/07/2011 it will be presented as Jul '11.

I have under the presentation tab hit Dropdown select and all the months are in a random order and i've no idea how to sort them into correct order.

Any ideas?

Paul.

1 Solution

Accepted Solutions
MVP
MVP

Re: Sorting Date output in correct order

Use something like

date( monthstart(Posting_Date),'MMM YY')


4 Replies
vivientexier
Contributor II

Re: Sorting Date output in correct order

In your script, create a field like this :

LOAD

,...

,...

,...

,Posting_Date*1 as Posting_Date_num

.

.

FROM ...

Then, in your object, ask QlikView to sort ("sort" tab) by expression. This expression will be "Posting_Date_num".

Not applicable

Re: Sorting Date output in correct order

Sorry I sent email prematurely

I am getting

Jan ‘12

Jan ‘12

Jan ‘12

Jan ‘12

Feb’ 12

Feb’ 12

Feb’ 12

Feb’ 12

Feb’ 12

  1. Etc.

It seems that a month is being presented in the drop down multiple times one for each record.

  1. Paul.
MVP
MVP

Re: Sorting Date output in correct order

Use something like

date( monthstart(Posting_Date),'MMM YY')


Not applicable

Re: Sorting Date output in correct order

Swuehl, you're a star, thank you!

Paul.