Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm using the 'week' function to retrive the week number of a date.
When the field's data is '01/01/2011' the result is '52'...!
I'll appreciate if someone can reply me with the reson for this, and also the proposed solution.
Thanks in advance,
David
Hi
Qlikview User IMHO the ISO definition for week numbering which is e.g. different from the one used in US I believe.
Week 1 is the week containig the first würdest oft the year.
Hope this helps,
Stefan
P.S. If you need different numbering, search the forum, I believe there are samples for Most Standard Systems.
Hi 52 is the last week of 2010.
1/1/2011 falls down in that week.
Try to catch this week during load andchange with 1.
C u,
Stefano
Damn Mobile..
I meant the week with the first thursday oft a year is week number 1.
Regards
Stefan
swuehl wrote:
Damn Mobile..
I meant the week with the first thursday oft a year is week number 1.
Regards
Stefan
With this infomration , I think I was able to sort this problem which I faced myself.
So I simply changed the script from
Week(Date) as Week
to
Week(Date+2) as Week
Seems to work!
I don't think that this will work in general.
Maybe you want to check out the compilation of different week numbering standards that John has posted some time ago:
http://community.qlik.com/message/72204
Regards,
Stefan
Hi,
David,
this will solve your problem
num(subfield(LunarWeekName ('1/1/2011'),'/' ,2))
Please check correct if you got ur answer
Try this
IF ((DayNumberOfYear(date)) < 7 and week(date) > 2 , 1 , week(date#( date, 'DD/MM/YYYY')))
Sivaraj S
I had the same issue and did not like how it was displaying so I used this formula. Not the most elegant or exact, but I works for me:
if(week(CalendarDate)>50 and month(CalendarDate)<10,1,week(CalendarDate)) as 'Calendar Week',
I just had issues with the sorting, not so much with the 52.
Definitely not elegant but it does work to avoid jumps on bar chart from one year to another.
Thanks !