Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
swuehl
MVP
MVP

Use something like

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


View solution in original post

4 Replies
vivientexier
Partner - Creator II
Partner - Creator II

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
Author

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.
swuehl
MVP
MVP

Use something like

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


Not applicable
Author

Swuehl, you're a star, thank you!

Paul.