<?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: Handling nulls within a loop in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Handling-nulls-within-a-loop/m-p/2024980#M84534</link>
    <description>&lt;P&gt;I assume that vNumRows is something like noofrows() and contained the number of records of the table. In this case the index starts by 1 whereby the index of peek() starts by 0 and therefore the loop runs one too often. Just adjust it by:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;for it_accounts=0 to $(vNumRows)&lt;STRONG&gt; - 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2023 14:04:20 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-01-12T14:04:20Z</dc:date>
    <item>
      <title>Handling nulls within a loop</title>
      <link>https://community.qlik.com/t5/App-Development/Handling-nulls-within-a-loop/m-p/2024966#M84533</link>
      <description>&lt;DIV class="headline edc_error"&gt;I'm getting this error when I try to loop through a list of clients to bring back their account level qvds. It &lt;EM&gt;should&amp;nbsp;&lt;/EM&gt;work like this: variable picks up AccountName from a list from a table called 'Client List', this variable then is input into a qvd filename within a loop, returning the records for that account from the qvd (stored earlier).&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;I'm currently getting a null coming through or "". So the loop errors when it can't find something called "_readings", because it should look like "[companyname]_readings". There are no nulls in the ClientList, so I need to exclude nulls instead but I'm not sure how to do that.&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;Cannot open file: 'lib://Admin - Account Data Files:DataFiles/_readings.qvd' (Connector error: File not found)&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;Here is the loop:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;for it_accounts=0 to $(vNumRows)&lt;BR /&gt;let vAcc=peek('AccountId',$(it),'temp_clientlist');&lt;BR /&gt;let vAccountName=peek('AccountName',$(it),'temp_clientlist');&lt;BR /&gt;let vFileAccountName=lower(replace('$(vAccountName)',' ',''));&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;This is where I enter the variable:&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;load *&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;FROM [lib://Admin - Account Data Files:DataFiles/$(vAccountName)_readings.qvd]&lt;BR /&gt;(qvd);&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jan 2023 13:43:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Handling-nulls-within-a-loop/m-p/2024966#M84533</guid>
      <dc:creator>BenjaminCoe1440</dc:creator>
      <dc:date>2023-01-12T13:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls within a loop</title>
      <link>https://community.qlik.com/t5/App-Development/Handling-nulls-within-a-loop/m-p/2024980#M84534</link>
      <description>&lt;P&gt;I assume that vNumRows is something like noofrows() and contained the number of records of the table. In this case the index starts by 1 whereby the index of peek() starts by 0 and therefore the loop runs one too often. Just adjust it by:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;for it_accounts=0 to $(vNumRows)&lt;STRONG&gt; - 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 14:04:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Handling-nulls-within-a-loop/m-p/2024980#M84534</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-01-12T14:04:20Z</dc:date>
    </item>
  </channel>
</rss>

