<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with week start in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489190#M182819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not if you change the variable that defines the minimum number of days in week one to 1:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #0000ff;"&gt;Set &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #808080;"&gt;&lt;EM style="font-family: inherit;"&gt;vMinDaysInWeek&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/SPAN&gt;= 1; &lt;SPAN style="font-style: inherit; font-family: inherit; color: #008000;"&gt;// Minimal number of days in week no 1. (For the U.S. = 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #008000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Oct 2013 09:27:59 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2013-10-18T09:27:59Z</dc:date>
    <item>
      <title>Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489186#M182815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a calendar having each week start on Thursday. I have read and applied various ideas from many posts but I still have a problem; the week number. In my case, The first week of the year starts from the first day of the year BUT it lasts until the first Wednesday of the year. For example, for year 2013 we shall have:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Day&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Week Number&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Tuesday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Wednesday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Thursday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Friday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Saturday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;6/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sunday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;7/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Monday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;8/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Tuesday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;9/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Wednesday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;10/1/2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Thursday&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of how I achieve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you in advance,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 08:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489186#M182815</guid>
      <dc:creator />
      <dc:date>2013-10-18T08:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489187#M182816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a script that does this in one of my blog posts: &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/10/23/ancient-gods"&gt;Ancient Gods and Modern Days&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:13:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489187#M182816</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-10-18T09:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489188#M182817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMinDate = num(MakeDate(2012,01,01));&lt;/P&gt;&lt;P&gt;Let vMaxDate = num(MakeDate(2012,12,31));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Date($(vMinDate) + RowNo() -1) as Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Week(Date($(vMinDate) + RowNo() -1)) as Week,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekDay(Date($(vMinDate) + RowNo() -1)) as WeekDay,&lt;/P&gt;&lt;P&gt;&amp;nbsp; num(WeekDay(Date($(vMinDate) + RowNo() -1))) as WeekDayNum,&lt;/P&gt;&lt;P&gt;&amp;nbsp; week(WeekStart(Date($(vMinDate) + RowNo() -1),0,3)) as NewWeek&lt;/P&gt;&lt;P&gt;AutoGenerate 1&lt;/P&gt;&lt;P&gt;While Date($(vMinDate) + RowNo() -1) &amp;lt; Date($(vMaxDate));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might not what you want, but i am sure this will help you to understand and then you can develop by our own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:18:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489188#M182817</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2013-10-18T09:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489189#M182818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;I have extensively used this exact post.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I think the problem is that the duration of week one is not static (7 days from the day I have defined as the first day of week).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In your example, week 1 would start from 3/1/2013 and the previous days will be week 52.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489189#M182818</guid>
      <dc:creator />
      <dc:date>2013-10-18T09:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489190#M182819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not if you change the variable that defines the minimum number of days in week one to 1:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #0000ff;"&gt;Set &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #808080;"&gt;&lt;EM style="font-family: inherit;"&gt;vMinDaysInWeek&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/SPAN&gt;= 1; &lt;SPAN style="font-style: inherit; font-family: inherit; color: #008000;"&gt;// Minimal number of days in week no 1. (For the U.S. = 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #008000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:27:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489190#M182819</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-10-18T09:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489191#M182820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try lunarweek(),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SubField(LunarWeekName(DateDimension), '/', 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:28:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489191#M182820</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-10-18T09:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489192#M182821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check whether below script helps you.&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt; Date,&lt;/P&gt;&lt;P&gt; Month(Date) as Month,&lt;/P&gt;&lt;P&gt; WeekDay(Date) as Day,&lt;/P&gt;&lt;P&gt; Num(WeekDay(Date)) as WkDay,&lt;/P&gt;&lt;P&gt; If((Day(Date)=1) and (Month(Date)=1),1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Num(WeekDay(Date))=3,Peek('WeekNo')+1,Peek('WeekNo'))) as WeekNo;&lt;/P&gt;&lt;P&gt;Resident YourTable; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing here is your Date field should have value starts from 1st January.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;GowriShankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489192#M182821</guid>
      <dc:creator />
      <dc:date>2013-10-18T09:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with week start</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489193#M182822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, you are right, I missed sth on the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:40:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-week-start/m-p/489193#M182822</guid>
      <dc:creator />
      <dc:date>2013-10-18T09:40:49Z</dc:date>
    </item>
  </channel>
</rss>

