Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

The Week Function.

Hello,

Please find attached an example where i have used the week function. Here it associates the 1st of January 2010 to the 53rd week.

Any comments why it should be so?

Thanks,

Ankur

1 Solution

Accepted Solutions
amien
Specialist
Specialist

Hi,

i had the same issue .. the problem is that the first of januari 2010 was in the last week of 2009. So .. ISO-wise .. this is correct.

the solution is to alter/manipulate the week number.

IF(Week (Date) = 53,1,Week (Date))

luckily week 53 doesnt exist in 2010..

View solution in original post

9 Replies
amien
Specialist
Specialist

Hi,

i had the same issue .. the problem is that the first of januari 2010 was in the last week of 2009. So .. ISO-wise .. this is correct.

the solution is to alter/manipulate the week number.

IF(Week (Date) = 53,1,Week (Date))

luckily week 53 doesnt exist in 2010..

amien
Specialist
Specialist

btw... ofcourse when adding more years .. add the year before the week

2010-53 --> 2010-01

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

The rules of assigning the weeks are different in different places... I believe, QlikView week belongs to the year in which it begins. Since week 53 begins in the "previous" year, Jan 1 of "this year" will still belong to that week.

Not applicable
Author

Thank You, Amien & Oleg for your reply.

Not applicable
Author

Hello,
I had also the problem showing the weeks of the first quarter 2010 in a Listbox from left to right.
I solved it by sorting not mumeric but by "Lade-Reihenfolge" (german -> means something like "by loading sequence", last checkbox - see properties.)
Perhaps it helps too.

Greetings dj_skbs

Not applicable
Author

Hi DJ,

Thank you for your reply, but in my case it was a SIB with two months data and the week list box showed Week 1 to 8 and then 53 !!!!

Regards,

Ankur

tanelry
Partner - Creator II
Partner - Creator II

I believe QlikView uses ISO standard for week numbering (see http://en.wikipedia.org/wiki/Seven-day_week#Week_numbering). Hence the first or last week may spread into two years.
Use "weekyear" function to find year number that corresponds to a week number.
For best clarity I always use year and week number joint together, like this:

weekyear(Date) & '_' & text(num(week(Date),'00')) as Year_Week

johnw
Champion III
Champion III

Yes, QlikView uses the ISO standard. There are other standards. If you want a complete solution, you're going to have to tell us what YOUR standard is. In any case, attached are sample formulas and demonstrated results for some of the standards that I've run across.

Not applicable
Author

Hello John & Tanelry,

Thank you for your reply. Thanks for the example John, its very helpful.

Regards,

Ankur