Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting date in bar chart not working

Hi everyone.

I spent the last two days trying to solve this problem and looking for solutions in the forum but none of them worked. So here's the issue.

I have dates in the table I'm loading in the following format: YYYYMMDD.

The script I'm using is the following:

date((date#(DASCAX,'YYYYMMDD')),'DD/MM/YYYY') as [Expiration date],


I'm using this to let Qlik interpret my date and convert it in DD/MM/YYYY format.

I then have to create a bar chart which has date in MM-YYYY (or alternatively MMM-YYYY) on the x-axis.

When I create the dimension I specify the following:

=Date([Expiration Date],'MM-YYYY')

The problem comes when I try to order dates: whichever expression I use, dates are displayed as follows:

Cattura.PNG

How can I sort them? What am I getting wrong?

Thanks in advance

g

1 Solution

Accepted Solutions
sunny_talwar

Have you tried to sort by your date dimension? And it should be sorted numerically

Capture.PNG

View solution in original post

5 Replies
OmarBenSalem

Try this, in your script, create a new field :

,AutoNumber([Expiration Date], '%Date ID') as [%Date ID]

then in your chart, sort by this [%Date ID]

Not applicable
Author

I lose any format (MM-YYYY) using autonumber in the script

OmarBenSalem

Keep your date field and add another field using autonumber.

In your chart, as a dimension use your date field and sort it by your DateID

sunny_talwar

Have you tried to sort by your date dimension? And it should be sorted numerically

Capture.PNG

Not applicable
Author

I wasn't paying attention at the sorting order. I thought disabling any kind of sorting for my measure (placed first than dimension) would do the work as well.

Thanks  Sunny as always.