<?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: Rolling 4 weeks Expression based on condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573576#M1120043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you mark this discussion as correct/helpful, in case others might find this useful? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jan 2014 18:57:30 GMT</pubDate>
    <dc:creator>jerem1234</dc:creator>
    <dc:date>2014-01-27T18:57:30Z</dc:date>
    <item>
      <title>Rolling 4 weeks Expression based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573573#M1120040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to provide a trend for open tickets per fiscal week. The definition of open per given fiscal week is that tickets created per give week is not closed at same week, also for tickets created prior to given week, if they are not closed by given week, it will also be counted as open per that week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, based on the sample data under model:&lt;/P&gt;&lt;P&gt;Sample:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;Record No,CreatedFW,ClosedFW,Flag&lt;/P&gt;&lt;P&gt;1,111,113,1&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;2,111,111,1&lt;/P&gt;&lt;P&gt;3,112,114,1&lt;/P&gt;&lt;P&gt;4,112,116,1&lt;/P&gt;&lt;P&gt;5,113,117,1&lt;/P&gt;&lt;P&gt;6,113,113,1&lt;/P&gt;&lt;P&gt;7,113,119,1&lt;/P&gt;&lt;P&gt;8,114,115,1&lt;/P&gt;&lt;P&gt;]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The count for each fiscal FW should be as follows:&lt;/P&gt;&lt;P&gt;111 - 1&amp;nbsp;&amp;nbsp;&amp;nbsp; (Record No: 1 )&lt;/P&gt;&lt;P&gt;112 - 3&amp;nbsp;&amp;nbsp;&amp;nbsp; (Record No: 3,4 + Record No: 1 )&amp;nbsp; //note, the reason Record No: 1 needs to be counted due to its close date &amp;gt; given fiscal&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; week (112)&lt;/P&gt;&lt;P&gt;113 - 4&amp;nbsp;&amp;nbsp;&amp;nbsp; (Record No: 5, 6&amp;nbsp; + Record No: 3, 4) //note: Record No: 5, 6 are those created current fiscal week, 113 with closed ate &amp;gt; 113.&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; while Record No: 3, 4 are created previously but not closed per 113 fiscal week&lt;/P&gt;&lt;P&gt;114 - 4&amp;nbsp;&amp;nbsp;&amp;nbsp; (Recod No: 8 + Record No: 5, 7 + Record No: 4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SQL, the query for the given fiscal week such as 114 will be as follows:&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM Sample&lt;/P&gt;&lt;P&gt;where createdFW &amp;lt;=114&lt;/P&gt;&lt;P&gt;and ClosedFW &amp;gt; 114&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the best way to handle this one in expression? Attached is my sample qvw. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please kindly advise!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 16:32:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573573#M1120040</guid>
      <dc:creator />
      <dc:date>2014-01-27T16:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 4 weeks Expression based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573574#M1120041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linling,&lt;/P&gt;&lt;P&gt;I would start by creating a FiscalWeek data island that just lists the weeks you want. I added this to your script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;FiscalWeek&lt;/P&gt;&lt;P&gt;111&lt;/P&gt;&lt;P&gt;112&lt;/P&gt;&lt;P&gt;113&lt;/P&gt;&lt;P&gt;114&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I used this formula with dimension FiscalWeek:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(if(ClosedFW &amp;gt; FiscalWeek and CreatedFW&amp;lt;=FiscalWeek, CreatedFW))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you the numbers you are looking for. Also changed the listbox to FiscalWeek.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 17:18:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573574#M1120041</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-27T17:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 4 weeks Expression based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573575#M1120042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are super awesome! It works like a magic... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 18:41:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573575#M1120042</guid>
      <dc:creator />
      <dc:date>2014-01-27T18:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 4 weeks Expression based on condition</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573576#M1120043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you mark this discussion as correct/helpful, in case others might find this useful? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 18:57:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-4-weeks-Expression-based-on-condition/m-p/573576#M1120043</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-27T18:57:30Z</dc:date>
    </item>
  </channel>
</rss>

