<?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 choosing weeks in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905620#M314754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Open Week Num], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Open Week] &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[\openweek.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact2:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;[Open Week] as [Open Week Dim],&lt;/P&gt;&lt;P&gt;[Open Week Num] as [Open Week Num Dim]&lt;/P&gt;&lt;P&gt;Resident Fact&lt;/P&gt;&lt;P&gt;where floor(num([Open Week]))&amp;gt;floor((num(max([Open Week]))))-112);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is one of the examples i tried..but no matter what where condition I put i keep getting script error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Apr 2015 17:49:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-04-13T17:49:03Z</dc:date>
    <item>
      <title>Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905618#M314752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have attached a sample qvd and qvw.&lt;/P&gt;&lt;P&gt;Basically I have an open week field which contains data for 3 years. I am trying to bring in data of only 16 latest weeks(available in the db) and its corresponding weeks from last year(same week number but year -1).&lt;/P&gt;&lt;P&gt;The result set should be&lt;/P&gt;&lt;P&gt;Open week dim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11/21/2014&lt;/P&gt;&lt;P&gt;11/28/2014&lt;/P&gt;&lt;P&gt;12/05/2014&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;03/06/2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and open week previous year&lt;/P&gt;&lt;P&gt;11/15/2013&lt;/P&gt;&lt;P&gt;11/22/2013&lt;/P&gt;&lt;P&gt;11/29/2013&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;03/07/2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why I am trying to do this in the script ?? because the size of the app is too big and I want to reduce it to contain only the relevant data.&lt;/P&gt;&lt;P&gt;I have tried lot of techniques but it keeps giving me script error.&lt;/P&gt;&lt;P&gt;Please help me in understanding how to reduce based on the data given.(also I would prefer if no hardcoding was done as this app needs to work for next year also.)&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 17:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905618#M314752</guid>
      <dc:creator />
      <dc:date>2015-04-13T17:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905619#M314753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post your script here, instead of looking at a 85MB file it might be easier to look at the portion of the script where you are facing the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 17:40:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905619#M314753</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-13T17:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905620#M314754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Open Week Num], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Open Week] &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[\openweek.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact2:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;[Open Week] as [Open Week Dim],&lt;/P&gt;&lt;P&gt;[Open Week Num] as [Open Week Num Dim]&lt;/P&gt;&lt;P&gt;Resident Fact&lt;/P&gt;&lt;P&gt;where floor(num([Open Week]))&amp;gt;floor((num(max([Open Week]))))-112);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is one of the examples i tried..but no matter what where condition I put i keep getting script error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 17:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905620#M314754</guid>
      <dc:creator />
      <dc:date>2015-04-13T17:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905621#M314755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This won't work like the way you have it in there. Try this instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Fact:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Open Week Num],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Open Week]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;[\openweek.qvd]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;(qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;MaxOpenWeek:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD Max([Open Week]) as MaxOpenWeek&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Resident Fact;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LET vMaxOpenWeek = Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;MaxOpenWeek&lt;/SPAN&gt;');&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Fact2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;[Open Week] as [Open Week Dim],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;[Open Week Num] as [Open Week Num Dim]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Resident Fact&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;where [Open Week]&amp;gt;($(vMaxOpenWeek)-112);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;DROP Tables Fact, MaxOpenWeek;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Give this a shot.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Best,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 18:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905621#M314755</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-13T18:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905622#M314756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this is what you wanted? (PFA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 18:13:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905622#M314756</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-13T18:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905623#M314757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked perfectly, If you do not mind can you explain why you did what you did (so that i have an insight on how qlikview functions) and also what do you think the expression for last year same week number should be??&lt;/P&gt;&lt;P&gt;Thanks for all your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 18:48:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905623#M314757</guid>
      <dc:creator />
      <dc:date>2015-04-13T18:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem choosing weeks in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905624#M314758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I may be wrong, but this is what I understand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you have this where statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;where floor(num([Open Week]))&amp;gt;floor((num(max([Open Week]))))-112);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;QlikView checks it for each row that [Open Week] &amp;gt; Max[Open Week]-112 which is always going to be true for any given row because (Example: [Open Week] = 01/01/2015 will always be greater than 01/01/2015 - 112 days)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used the Peek function, Max([Open Week]) is not a field value, it changes into a static value and now I can compare a static value to a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope what I said make sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 19:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-choosing-weeks-in-the-script/m-p/905624#M314758</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-13T19:04:28Z</dc:date>
    </item>
  </channel>
</rss>

