Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

gireesh007
New Contributor III

i need to modify the master calendar

HI everyone,

as per callendar i need to show tha date for

44 week of 2016 i need to show in  oct-30-nov-5  (30-10-2016 to 5-11-2016)

45   week of 2016 i need to show in  nov 6to12 (6-11-2016 to 12-11-2016)

46   week of 2016 i need to show in  nov-13-19  (13-11-2016 to 19-11-2016)

But here in my  master calendar it's showing wrong date what the logic i need to change to show the normal calendar dates, can some one check and suggest me to get regular calendar week

for refference attached sample qvd below

Regards,

Girish !

3 Replies

Re: i need to modify the master calendar

You can create your week field as below..

Week(YourDateField+1) as Week

Re: i need to modify the master calendar

Hi Gireesh, week 44 starts on 31/10/2016 to 06/11/2016 (or 30/10/2016 to 05/11/2016 if week starts on sunday). I think Qv uses ISO-8601, in this case when the first week of january has less days than the last week in december (this is when 1 of january is friday, saturday or sunday) , the first week is the '53' week, so week 1 in 2016 starts on 04/01/2016 (or 03/01/2016 if weeks starts on sunday)

If you want that 1 of january is week 1 you have to generate your weeks numbers using something like:

=Ceil((Date(DateField)-YearStart(DateField)+WeekDay(YearStart(DateField))+1) /7)


This is for weeks starting on monday, maybe it needs a fix to work with weeks starting on sunday.

Re: i need to modify the master calendar

Updated: set the varaiable for weeks to work the way I commented above:

SET BrokenWeeks=0; //You actually setted to 1, so 01/01/2016 is week 1

Community Browser