<?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 Strange problem with script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333556#M29138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a snippet of a script that I am working on:&lt;/P&gt;&lt;P&gt;DataRaw:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;path, path_count&lt;/P&gt;&lt;P&gt;'String1',2&lt;/P&gt;&lt;P&gt;'String2',1&lt;/P&gt;&lt;P&gt;'String3',1&lt;/P&gt;&lt;P&gt;'String4',2&lt;/P&gt;&lt;P&gt;'String5',1&lt;/P&gt;&lt;P&gt;'String6',1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let numRows = NoOfRows('DataRaw');&lt;/P&gt;&lt;P&gt;For myRow = 1 to NoOfRows('DataRaw')&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vFld = FieldValue('path',myRow);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vCount = FieldValue('path_count',myRow);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let myPlace = 1;&lt;/P&gt;&lt;P&gt;Next myRow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first two rows of the data process just fine but I am getting Null for the value of vCount at the third row and every row after that.&amp;nbsp; Here is my debug output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2017-04-03_17-27-58.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/158768_2017-04-03_17-27-58.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Apr 2017 22:35:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-03T22:35:13Z</dc:date>
    <item>
      <title>Strange problem with script</title>
      <link>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333556#M29138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a snippet of a script that I am working on:&lt;/P&gt;&lt;P&gt;DataRaw:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;path, path_count&lt;/P&gt;&lt;P&gt;'String1',2&lt;/P&gt;&lt;P&gt;'String2',1&lt;/P&gt;&lt;P&gt;'String3',1&lt;/P&gt;&lt;P&gt;'String4',2&lt;/P&gt;&lt;P&gt;'String5',1&lt;/P&gt;&lt;P&gt;'String6',1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let numRows = NoOfRows('DataRaw');&lt;/P&gt;&lt;P&gt;For myRow = 1 to NoOfRows('DataRaw')&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vFld = FieldValue('path',myRow);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vCount = FieldValue('path_count',myRow);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let myPlace = 1;&lt;/P&gt;&lt;P&gt;Next myRow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first two rows of the data process just fine but I am getting Null for the value of vCount at the third row and every row after that.&amp;nbsp; Here is my debug output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2017-04-03_17-27-58.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/158768_2017-04-03_17-27-58.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 22:35:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333556#M29138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-03T22:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem with script</title>
      <link>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333557#M29139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the same result.&amp;nbsp; What about using Peek?&amp;nbsp; I had better luck with Peek.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;DataRaw:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Inline&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; path, path_count&lt;BR /&gt; 'String1',2&lt;BR /&gt; 'String2',1&lt;BR /&gt; 'String3',1&lt;BR /&gt; 'String4',2&lt;BR /&gt; 'String5',1&lt;BR /&gt; 'String6',1&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;numRows&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('DataRaw');&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;For&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;myRow&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('DataRaw')-1)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vFld&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('path', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;myRow&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DataRaw');&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Let vFld = FieldValue('path',myRow);&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vCount&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('path_count', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;myRow&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DataRaw');&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Let vCount = FieldValue('path_count',myRow);&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;myPlace&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Next&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;myRow&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 23:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333557#M29139</guid>
      <dc:creator>craigsutton</dc:creator>
      <dc:date>2017-04-03T23:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem with script</title>
      <link>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333558#M29140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well after much hair pulling the solution seemed to be to use the Peek function instead of FieldValue and also specify the table name.&amp;nbsp; Additionally the first record for use with Peek is record 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the script should look like this...&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;For myRow = 0 to NoOfRows('DataRaw')-1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Let vFld = Peek('path',myRow,'DataRaw');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vCount = Peek('path_count',myRow&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;,'DataRaw'&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let myPlace = 1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Next myRow&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 23:30:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333558#M29140</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-03T23:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Strange problem with script</title>
      <link>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333559#M29141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We were typing at the same time.&amp;nbsp; I'll mark yours as correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 23:31:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Strange-problem-with-script/m-p/1333559#M29141</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-03T23:31:42Z</dc:date>
    </item>
  </channel>
</rss>

