<?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 What's wrong in my FOR ... NEXT ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200134#M58792</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for &lt;STRONG&gt;sparur, using&lt;/STRONG&gt; fieldvaluecount('Product') is OK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jun 2010 08:01:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-06-24T08:01:21Z</dc:date>
    <item>
      <title>What's wrong in my FOR ... NEXT ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200132#M58790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;------------------------------my script:&lt;/P&gt;&lt;P&gt;Fact_SKU_Price:&lt;BR /&gt;load distinct ID&lt;BR /&gt; ,Brand&amp;amp;' '&amp;amp;Package as Product_Name&lt;BR /&gt; ,Retail_Price as Retail_Price&lt;BR /&gt;resident SKU_Price_temp;&lt;/P&gt;&lt;P&gt;Dim_Product:&lt;BR /&gt;load distinct Product_Name as Product&lt;BR /&gt;resident Fact_SKU_Price;&lt;/P&gt;&lt;P&gt;FOR i = 0 TO NoOfRows('Product') - 1&lt;/P&gt;&lt;P&gt;LET vProduct = peek('Product', $(i));&lt;/P&gt;&lt;P&gt;LOAD ID&lt;BR /&gt; ,Retail_Price as '$(vProduct ) '&lt;BR /&gt; RESIDENT SKU_Price&lt;BR /&gt; where Product = '$(vProduct )';&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;I want to Anti-Crosstable the price value of every product. In the debug, I saw the value of vProduct is correct in the first loop. But from begining of the second loop, the value of vProduct is always 'NULL'.&lt;/P&gt;&lt;P&gt;But if the FOR...NEXT is simply following,the value of vProduct is always correct in debug :&lt;/P&gt;&lt;P&gt;FOR i = 0 TO NoOfRows('Product') - 1&lt;/P&gt;&lt;P&gt;LET vProduct = peek('Product', $(i));&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's wrong with my script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jun 2010 03:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200132#M58790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-24T03:49:20Z</dc:date>
    </item>
    <item>
      <title>What's wrong in my FOR ... NEXT ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200133#M58791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Jonh.&lt;/P&gt;&lt;P&gt;Why do you use NoOfRows() function for field?&lt;/P&gt;&lt;P&gt;You should use a fieldvaluecount('Product') or NoOfRows('Dim_Product')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jun 2010 06:29:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200133#M58791</guid>
      <dc:creator>sparur</dc:creator>
      <dc:date>2010-06-24T06:29:54Z</dc:date>
    </item>
    <item>
      <title>What's wrong in my FOR ... NEXT ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200134#M58792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for &lt;STRONG&gt;sparur, using&lt;/STRONG&gt; fieldvaluecount('Product') is OK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jun 2010 08:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-in-my-FOR-NEXT/m-p/200134#M58792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-24T08:01:21Z</dc:date>
    </item>
  </channel>
</rss>

