<?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: Error with &amp;quot;For i = 0 to (vNumberOfRows - 1)&amp;quot; in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605823#M4231</link>
    <description>&lt;P&gt;The whole "Governed Metrics" code piece runs fine for me without any errors, and I see the variables have all been defined correctly:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 774px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15994iBCAD50A65C70BABB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You may need to reach out to Qlik Support because I have no idea why it would be working on my machine but not yours.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2019 18:07:10 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2019-07-24T18:07:10Z</dc:date>
    <item>
      <title>Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605311#M4214</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have the following script:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Variables-Formulas]:&lt;BR /&gt;LOAD&lt;BR /&gt;[Variable-Formula],&lt;BR /&gt;Expression,&lt;BR /&gt;Usage&lt;BR /&gt;FROM [lib://Matrix Variables-Formulas (uhealth_54171224)/Matrix Variables-Formulas.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is [Variables-Formulas]);&lt;BR /&gt;LET vNumberOfRows = NoOfRows('Variables-Formulas');&lt;BR /&gt;For i = 0 to (vNumberOfRows - 1)&lt;BR /&gt;LET vVariable_Name = Peek('Variable-Formula',i,'Expression');&lt;BR /&gt;LET [$(vVariable_Name)] = Peek('Expression',i,'Expression');&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;NullAsValue "UMHC SCCC",&lt;BR /&gt;"UHealth Tower",&lt;BR /&gt;"UMHC BPEI",&lt;BR /&gt;"UMHC LFMC",&lt;BR /&gt;"UMHC Radiology",&lt;BR /&gt;"UMHC Applebaum",&lt;BR /&gt;"UMHC Ear Institute",&lt;BR /&gt;"UMHC Pain Clinic",&lt;BR /&gt;"UMHC Safie",&lt;BR /&gt;"UMHC IR Clinic",&lt;BR /&gt;"UMHC Coral Spring",&lt;BR /&gt;"UMHC Deerfield",&lt;BR /&gt;"UMHC Hollywood",&lt;BR /&gt;"UMHC Kendall",&lt;BR /&gt;"UMHC Plantation",&lt;BR /&gt;"UMHC Marlin Park";&lt;BR /&gt;SET NullValue = '0';&lt;/P&gt;&lt;P&gt;[Map EC-LS-EM]:&lt;BR /&gt;MAPPING Load *&lt;BR /&gt;Inline [&lt;BR /&gt;EC-LS-EM, Description&lt;BR /&gt;EC, Environment of Care&lt;BR /&gt;LS, Life Safety&lt;BR /&gt;EM, Emergency Management&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which had been working fine but now I am getting this error:&lt;/P&gt;&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="headline edc_error"&gt;&lt;STRONG&gt;The error occurred here:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;&lt;STRONG&gt;For i = to&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not really sure what is happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 20:12:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605311#M4214</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2021-12-21T20:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605313#M4215</link>
      <description>&lt;P&gt;You need to use dollar sign expansion around the variable name:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For i = 0 to ($(vNumberOfRows) - 1)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 18:54:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605313#M4215</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2019-07-23T18:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605314#M4216</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I do that, I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;Unexpected token: ')', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', 'LITERAL_NUMBER', ...&lt;/DIV&gt;&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="headline edc_error"&gt;The error occurred here:&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;For i = 0 to (&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;)&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jul 2019 18:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605314#M4216</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2019-07-23T18:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605315#M4217</link>
      <description>&lt;P&gt;That error is coming from the values you are trying to store in&amp;nbsp;vVariable_Name and&amp;nbsp;[$(vVariable_Name)].&amp;nbsp; Change those from LET to SET.&lt;/P&gt;&lt;P&gt;(And make sure to leave the dollar sign expansion on the FOR.)&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 19:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605315#M4217</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2019-07-23T19:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605316#M4218</link>
      <description>&lt;P&gt;Ok So I changed them to SET:&lt;/P&gt;&lt;P&gt;For i = 0 to ($(vNumberOfRows - 1))&lt;BR /&gt;SET vVariable_Name = Peek('Variable-Formula',i,'Expression');&lt;BR /&gt;SET [$(vVariable_Name)] = Peek('Expression',i,'Expression');&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I still get that error?&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 19:04:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605316#M4218</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2019-07-23T19:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605320#M4220</link>
      <description>&lt;P&gt;You have some incorrect arguments in your PEEK functions.&amp;nbsp; The third argument should be table name:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[Variables-Formulas]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Variable-Formula],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Usage&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM [lib://Matrix Variables-Formulas (uhealth_54171224)/Matrix Variables-Formulas.xlsx]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(ooxml, embedded labels, table is [Variables-Formulas]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LET vNumberOfRows = NoOfRows('Variables-Formulas');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For i = 0 to ($(vNumberOfRows) - 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LET vVariable_Name = Peek('Variable-Formula',i,'&lt;FONT color="#FF0000"&gt;Variables-Formulas&lt;/FONT&gt;');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LET [$(vVariable_Name)] = Peek('Expression',i,'&lt;FONT color="#FF0000"&gt;Variables-Formulas&lt;/FONT&gt;');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And leave them as LET statements--the PEEKs won't evaluate otherwise.&amp;nbsp; I missed that previously.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 19:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605320#M4220</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2019-07-23T19:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605631#M4222</link>
      <description>&lt;P&gt;Hi thank you, but that is still causing me an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;Unexpected token: ')', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', 'LITERAL_NUMBER', ...&lt;/DIV&gt;&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="headline edc_error"&gt;The error occurred here:&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;For i = 0 to (&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;)&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Jul 2019 12:24:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605631#M4222</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2019-07-24T12:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605742#M4224</link>
      <description>&lt;P&gt;This example works:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;[Variables-Formulas]:&lt;BR /&gt;LOAD [Variable-Formula],&lt;BR /&gt;[Expression],&lt;BR /&gt;[Usage]&lt;BR /&gt;INLINE [&lt;BR /&gt;Variable-Formula, Expression, Usage&lt;BR /&gt;Test 1, min(Usage), 10&lt;BR /&gt;Test 2, max(Usage), 20&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;LET vNumberOfRows = NoOfRows('Variables-Formulas');&lt;BR /&gt;For i = 0 to ($(vNumberOfRows) - 1)&lt;BR /&gt;LET vVariable_Name = Peek('Variable-Formula',i,'Variables-Formulas');&lt;BR /&gt;LET [$(vVariable_Name)] = Peek('Expression',i,'Variables-Formulas');&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;SET vNumberOfRows =;&lt;BR /&gt;SET i =;&lt;BR /&gt;SET vVariable_Name =;&lt;/P&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can you share the Excel file?&amp;nbsp; It has to do with the values in there that you're trying to pass into the variables.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 15:03:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605742#M4224</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2019-07-24T15:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605744#M4225</link>
      <description>&lt;P&gt;Yes of course, I have attached it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is just strange since I haven't changed anything on that sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for all your help!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 15:08:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605744#M4225</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2019-07-24T15:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605756#M4226</link>
      <description>&lt;P&gt;This code works fine for me when I run it (no errors and it creates all variables):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Variables-Formulas]:
LOAD [Variable-Formula],
	[Expression],
	[Usage]
FROM [lib://Desktop/Matrix Variables-Formulas.xlsx]
(ooxml, embedded labels, table is [Variables-Formulas]);

LET vNumberOfRows = NoOfRows('Variables-Formulas');
For i = 0 to ($(vNumberOfRows) - 1)
	LET vVariable_Name = Peek('Variable-Formula',i,'Variables-Formulas');
	LET [$(vVariable_Name)] = Peek('Expression',i,'Variables-Formulas');
Next

SET vNumberOfRows =;
SET i =;
SET vVariable_Name =;&lt;/LI-CODE&gt;&lt;P&gt;What version are you running?&amp;nbsp; I'm using Desktop April 2019.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 15:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605756#M4226</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2019-07-24T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605794#M4228</link>
      <description>&lt;P&gt;I am running a much older version.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to see if they can update it for me, maybe that is what the problem is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 16:46:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605794#M4228</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2019-07-24T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605805#M4229</link>
      <description>&lt;P&gt;So I updated to April 2019 and I am still getting that error &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp; I attached the qvf, I'm not really sure what else it can be?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 17:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605805#M4229</guid>
      <dc:creator>hammermill21</dc:creator>
      <dc:date>2019-07-24T17:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error with "For i = 0 to (vNumberOfRows - 1)"</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605823#M4231</link>
      <description>&lt;P&gt;The whole "Governed Metrics" code piece runs fine for me without any errors, and I see the variables have all been defined correctly:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 774px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15994iBCAD50A65C70BABB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You may need to reach out to Qlik Support because I have no idea why it would be working on my machine but not yours.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 18:07:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Error-with-quot-For-i-0-to-vNumberOfRows-1-quot/m-p/1605823#M4231</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2019-07-24T18:07:10Z</dc:date>
    </item>
  </channel>
</rss>

