<?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 Peek function is not working in for loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323522#M119235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Take the variable $ and brackets away from your 'k' reference. Eg: 'Let &lt;SPAN class="jive-sql-keyword"&gt;data&lt;/SPAN&gt; = Peek('DistLotNo',k,'DistinctLotNo');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Nov 2011 09:35:51 GMT</pubDate>
    <dc:creator>matt_crowther</dc:creator>
    <dc:date>2011-11-16T09:35:51Z</dc:date>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323521#M119234</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;See the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;DistinctLotNo:&lt;/P&gt;&lt;P&gt;LOAD Distinct LotNo as DistLotNo&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Table1&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; for k =0 to (NoOfRows('DistinctLotNo')-1)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt; Let data = Peek('DistLotNo',$(k));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOAD&amp;nbsp;&amp;nbsp; LotNo,A,B,C,D&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Table1.qvd(qvd)&lt;/P&gt;&lt;P&gt;Where LotNo = '$(data)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT k&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Here the peek function is not working properly. What i'm saying is for 1st iteration data variable can able to hold the value but in 2nd second iteration the data variable shows the &lt;STRONG&gt;NULL &lt;/STRONG&gt;value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 09:02:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323521#M119234</guid>
      <dc:creator />
      <dc:date>2011-11-16T09:02:08Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323522#M119235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Take the variable $ and brackets away from your 'k' reference. Eg: 'Let &lt;SPAN class="jive-sql-keyword"&gt;data&lt;/SPAN&gt; = Peek('DistLotNo',k,'DistinctLotNo');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 09:35:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323522#M119235</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-11-16T09:35:51Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323523#M119236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.. I don't know what i did now my code is executing perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 09:51:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323523#M119236</guid>
      <dc:creator />
      <dc:date>2011-11-16T09:51:34Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323524#M119237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got problem again but when i use your code it is working perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 10:51:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323524#M119237</guid>
      <dc:creator />
      <dc:date>2011-11-16T10:51:53Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323525#M119238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if it's about the variable enclosing in $() or not, but I think it's definitely about using the third parameter to peek function given the table name - you'll need that outside a table load context, I believe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 11:26:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323525#M119238</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-16T11:26:43Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323526#M119239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know where i'm doing wrong. Sometimes my code is working excellently but sometimes not. I'm using every time same data only there is now change in my data.&lt;/P&gt;&lt;P&gt;But if i use the code given by Matt.. It is working everytime for n no. of executions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 12:01:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323526#M119239</guid>
      <dc:creator />
      <dc:date>2011-11-16T12:01:42Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323527#M119240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you don't have a problem then &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No seriously, I assume you are comparing your code with Matts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As said, Matt has indicated the table name with third parameter, I believe that is making the difference. I'm not quite sure why yours seems to work from time to time, and I would have also used the dollar sign variable syntax like in your original code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for now, if Matts code is working just fine, you don't have a problem, do you?&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, 16 Nov 2011 12:07:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323527#M119240</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-16T12:07:56Z</dc:date>
    </item>
    <item>
      <title>Peek function is not working in for loop</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323528#M119241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i use dollar sign in matt code i don't have any problem. Any way it's working fine thanks to share your knowledge also on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 12:17:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-function-is-not-working-in-for-loop/m-p/323528#M119241</guid>
      <dc:creator />
      <dc:date>2011-11-16T12:17:28Z</dc:date>
    </item>
  </channel>
</rss>

