Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Calender - More values in the last week of the year

Hi Folks,

I having problem with calnder last week. when I selected 52 week in the Weeks, I got values from 12/27/2011 to 1/2/2011. But the values Jan 1st & 2nd values didn't got in 2011 Week1. Please find the attched png and qvw.

Please suggest how can i overcome this.

Thanks in Advance .........

Regards,

Siri

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Calender - More values in the last week of the year

I believe QlikView is using ISO 8601 week numbers.  In the ISO week date system, January 1-2 are part of the last week of 2010.  It sounds like you might want this instead?

1+ceil((Date-floor(weekend(yearstart(Date))))/7)

3 Replies
MVP
MVP

Re: Calender - More values in the last week of the year

I believe QlikView is using ISO 8601 week numbers.  In the ISO week date system, January 1-2 are part of the last week of 2010.  It sounds like you might want this instead?

1+ceil((Date-floor(weekend(yearstart(Date))))/7)

Not applicable

Calender - More values in the last week of the year

Hi John,

Thanks for your reply and achive it.

Thanks...........

sofiene_1920
New Contributor III

Re: Calender - More values in the last week of the year

Hi John,

Good Solution to calculate the WTD :

1+ceil((Date-floor(weekend(yearstart(Date))))/7)

Je l'utilise déjà pour le calcule du WTD (le cumule hebdomadaire des ventes) mais il y a un choix stratégique à faire avant de l'utiliser !

Soit qu'on veut commencer notre analyse par la première semaine de l'année en cours qui peut contenir que deux jours comme l'exemple que tu viens de présenter (1+2 janvier) et on la compte une semaine (numéro 1 non pas 52).

Soit nous comptons que les semaines pleines du lundi au dimanche quelque soit l'année / mois / date, dans ce cas là, la première semaine sera celle du 03/01/2011.

Merci.

thx

Community Browser