<?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: Get the Week Number Starting from the Current week in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370044#M833990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&amp;nbsp; Digvijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It actually works.&amp;nbsp; Thank you so much&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; ...I've been stuck on this for days.&amp;nbsp; Anyway, If you could explain to me the 3rd IF statement , it would be great....it's quite confusing for beginners like me.&amp;nbsp; Also, why are your using today(1)?&amp;nbsp; What's the difference with today()? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jun 2017 22:49:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-01T22:49:02Z</dc:date>
    <item>
      <title>Get the Week Number Starting from the Current week</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370042#M833988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone can help me on this.&amp;nbsp; I have a series of Mon&amp;nbsp; dates that are not in order&amp;nbsp; in a given table where there are also a bunch of other fields .&amp;nbsp; I want to assign a&amp;nbsp; week number to start at the current Mon Date.&amp;nbsp; If the Monday Date &amp;lt; today's Monday date, 0,&lt;/P&gt;&lt;P&gt;If today is current Mon Date, 1 otherwise Week 1+2 and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the peek function but it's giving me the right values/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekstart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Mon_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekstart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()),0 ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekstart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Mon_Date&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekstart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()),1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Week Number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)+1 ))&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Week Number] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the peek function but&amp;nbsp; output is different from what I expected ...Below is my expected output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/165436_pastedImage_3.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370042#M833988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Week Number Starting from the Current week</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370043#M833989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works with your sample data - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load MondayDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(weekstart(MondayDate) &amp;lt; weekstart(today(1)),0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(weekstart(MondayDate) = weekstart(today(1)),1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(weekstart(MondayDate)&amp;lt;&amp;gt; weekstart(Peek(MondayDate)),rangesum(peek([Week Number]),1),Peek([Week Number])))) as [Week Number]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; inline [&lt;/P&gt;&lt;P&gt;MondayDate&lt;/P&gt;&lt;P&gt;5/22/2017&lt;/P&gt;&lt;P&gt;5/22/2017&lt;/P&gt;&lt;P&gt;5/22/2017&lt;/P&gt;&lt;P&gt;5/22/2017&lt;/P&gt;&lt;P&gt;5/29/2017&lt;/P&gt;&lt;P&gt;5/29/2017&lt;/P&gt;&lt;P&gt;5/29/2017&lt;/P&gt;&lt;P&gt;5/29/2017&lt;/P&gt;&lt;P&gt;5/29/2017&lt;/P&gt;&lt;P&gt;6/5/2017&lt;/P&gt;&lt;P&gt;6/5/2017&lt;/P&gt;&lt;P&gt;6/5/2017&lt;/P&gt;&lt;P&gt;6/5/2017&lt;/P&gt;&lt;P&gt;6/12/2017&lt;/P&gt;&lt;P&gt;6/19/2017&lt;/P&gt;&lt;P&gt;6/26/2017&lt;/P&gt;&lt;P&gt;7/3/2017&lt;/P&gt;&lt;P&gt;7/10/2017 ];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 00:19:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370043#M833989</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2017-06-01T00:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Week Number Starting from the Current week</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370044#M833990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&amp;nbsp; Digvijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It actually works.&amp;nbsp; Thank you so much&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; ...I've been stuck on this for days.&amp;nbsp; Anyway, If you could explain to me the 3rd IF statement , it would be great....it's quite confusing for beginners like me.&amp;nbsp; Also, why are your using today(1)?&amp;nbsp; What's the difference with today()? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 22:49:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370044#M833990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-01T22:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Week Number Starting from the Current week</title>
      <link>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370045#M833991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The control comes to third IF only when the date is higher than today() but if the previous row date is same as current row date, we don't want to add 1 to the count. So third IF keeps counter same as long as new row date is same as previous row date.&lt;/P&gt;&lt;P&gt;Today(1) take the date of&amp;nbsp; function called. Not sure of default , the help says - &lt;/P&gt;&lt;P style="font-size: 14px; margin: 0 0 5px; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-size: 14px; margin: 0 0 5px; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;Can have the following values:&lt;/P&gt;&lt;P style="font-size: 14px; margin: 0 0 5px; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;0 (day of last finished data load)&lt;BR /&gt;1 (day of function call)&lt;BR /&gt;2 (day when the app was opened)&lt;/P&gt;&lt;P class="note" style="background: #f4f4f4; padding: 10px 10px 10px 55px; margin-bottom: 10px; margin-top: 10px; border-left: 3px solid #007fca; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt;If you use the function in a data load script, &lt;SPAN class="statement" data-mc-conditions="Targets.NotToTranslate" style="font-weight: bold;"&gt;timer_mode=0&lt;/SPAN&gt; will result in the day of the last finished data load, while &lt;SPAN class="statement" data-mc-conditions="Targets.NotToTranslate" style="font-weight: bold;"&gt;timer_mode=1&lt;/SPAN&gt; will give the day of the current data load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 23:24:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-the-Week-Number-Starting-from-the-Current-week/m-p/1370045#M833991</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2017-06-01T23:24:54Z</dc:date>
    </item>
  </channel>
</rss>

