Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
johnso2080
Contributor
Contributor

Ordering Dates

Hello,

I want to create a trend graph showing a weeks sales by date for this year, and the same equivalent week last year. I have data that is (basically)...

DateSales (TY)
Sales (LY)
1 Feb 2012
120
2 Feb 2012
130
3 Feb 2012
140
4 Feb 2012
150
5 Feb 2012
160
6 Feb 2012
170
7 Feb 2012
180
3 Feb 2013210
4 Feb 2013220
5 Feb 2013230
6 Feb 2013240
7 Feb 2013250
8 Feb 2013260
9 Feb 2013270

In the chart I'm using a dimension that shows each date in the format 'dd MMM' so that the years overlap, so it should look like...

But in qlikview the dates appear in the wrong order on the x-axis. I can't sort them by date because, for example, 9 Feb last year occurs before 1 Feb this year.

Can anyone offer any advice?

Thanks

Darren

2 Replies
johnso2080
Contributor
Contributor
Author

trendchart.jpg

(missing image)

Anonymous
Not applicable

Darren,

You need to create a year-independent "date" in your calendar, and use it in the chart.  To keep it in a valid date format, just use any year.  In the example here I use year 0 (as good as any):

date(MakeDate(0, month(Date), day(Date)), 'DD MMM') as ChartDate

Regards.

Michael