Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using a dual Year&Week as the only dimension of a bar chart (see attachment).
I load Year&Week in script as
Dual(Year(DateId)&' '&Week(DateId),WeekStart(DateId)) as YearWeek
DateId is a plain date
I set the dimension's sorting order to numeric ascending as I would have expected the numeric value of the dual YearWeek to be used. However this does not seem to be the case as the result is:
2012 52
2012 1
2012 2
2012 3
...
2013 51
2013 52
2013 1
When loading years 2012 and 2013.
I've tried lots of different approaches from using other sorting orders up to interpreting YearWeek as string only. None of which yielded a correct result.
Anyone any idea what I'm overlooking?
Thanks and cheers
Benjamin
Hi,
Try with this
Dual(Year(DateId)&' '&Week(DateId),Num(Year(DateId)&Num(Week(DateId),'00'))) as YearWeek,
Hi,
I guess nothing is wrong in your sorting, only thing is the year field which you have created is wrong.
Let me give you an example.
You have written
Dual(Year(DateId)&' '&Week(DateId),WeekStart(DateId)) as YearWeek,
So now consider the date 01.01.2012.
The week for this date is 52 (which is of last year i.e year 2011) but in your field it shows as 2012 52, which is wrong, correct is 2011 52.
So change your expression to.
Dual(Year(weekstart(DateId))&' '&Week(DateId),WeekStart(DateId)) as YearWeek
Hope this is clear to you.
Regards,
Kaushik Solanki