<?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: week returns wrong value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399697#M148742</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to redefine the Week numbers altogether, you can use &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Div(date-YearStart(date)+WeekDay(YearStart(date))+7,7) as WeekNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will always return week 1 for Jan 1st. It will use Monday as the first day of the week. If you want Sunday as the first day of the week, you should use &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Div(date-YearStart(date) + WeekDay(YearStart(date)+1) +7,7) as WeekNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Sep 2012 14:49:11 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2012-09-13T14:49:11Z</dc:date>
    <item>
      <title>week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399690#M148735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why does the function week return 53 for the date 01.01.2010????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;MT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 11:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399690#M148735</guid>
      <dc:creator />
      <dc:date>2012-09-12T11:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399691#M148736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1/1/2010 was on a Friday. I guess that Qlikview interprets that as being in the last week of 2009.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 11:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399691#M148736</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2012-09-12T11:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399692#M148737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe QV uses ISO 8601 for its date and calendar functions:&lt;/P&gt;&lt;P&gt;&lt;A class="loading active_link" href="http://en.wikipedia.org/wiki/ISO_8601" title="http://en.wikipedia.org/wiki/ISO_8601"&gt;http://en.wikipedia.org/wiki/ISO_8601&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So week 53 is correct for that date. [Check also the weekyear(DATE) function.]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 11:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399692#M148737</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-09-12T11:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399693#M148738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically there are two parameters when calculating week numbers: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When does week 1 start? In the US week 1 always starts at Jan 1. But the ISO standard (used in Europe) says that week 1 is the first week containing 4 or more days. So, in Europe Jan 1st can belong to week 53.&lt;/LI&gt;&lt;LI&gt;On what weekday does the week start? In the US, the week starts on the Sunday. The ISO standard (which most of Europe uses) prescribes that the Week starts on Monday. And in the middle east, the week starts on Saturday.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Today, QlikView only supports the ISO standard for both these bullets (hard-coded in the product).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 12:53:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399693#M148738</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-09-12T12:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399694#M148739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hm...is there anyway i could make the 53 to a 52??? cause like that the chart i created is not really readable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;MT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 07:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399694#M148739</guid>
      <dc:creator />
      <dc:date>2012-09-13T07:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399695#M148740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sure, if(week(SomeDate)=53,52,week(SomeDate))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 11:55:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399695#M148740</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-09-13T11:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399696#M148741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use &lt;/P&gt;&lt;P&gt;week( Date ) -1&lt;/P&gt;&lt;P&gt;in order to differenciate the two consecutive last weeks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 14:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399696#M148741</guid>
      <dc:creator>rlp</dc:creator>
      <dc:date>2012-09-13T14:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399697#M148742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to redefine the Week numbers altogether, you can use &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Div(date-YearStart(date)+WeekDay(YearStart(date))+7,7) as WeekNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will always return week 1 for Jan 1st. It will use Monday as the first day of the week. If you want Sunday as the first day of the week, you should use &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Div(date-YearStart(date) + WeekDay(YearStart(date)+1) +7,7) as WeekNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 14:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399697#M148742</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-09-13T14:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399698#M148743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henric- I have the opposite problem, it is interpreting 12/30/2013 &amp;amp; 12/31/2013 as week 1.&lt;/P&gt;&lt;P&gt;And I need them to be week 53.&lt;/P&gt;&lt;P&gt;Is it possible to correct this in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 18:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399698#M148743</guid>
      <dc:creator />
      <dc:date>2014-01-07T18:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: week returns wrong value</title>
      <link>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399699#M148744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Div(date-YearStart(date) + WeekDay(YearStart(date)+1) +7,7) as WeekNumber&lt;/P&gt;&lt;P&gt;will return 53 for 12/30/3013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which type of week number do you want? I assume that it is the type "6/1/1" in the chart below (Week numbers are numbers with colored background.). If so you can use the above formula.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Newyear.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/51177_Newyear.png" style="width: 620px; height: 113px;" /&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 20:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-returns-wrong-value/m-p/399699#M148744</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-01-07T20:19:26Z</dc:date>
    </item>
  </channel>
</rss>

