<?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 Reload fails with error on End Sub in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reload-fails-with-error-on-End-Sub/m-p/309133#M114127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a piece of script which is like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;connect to database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Load_DB(year, week)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_Table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load myField&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select ... From ... Where DB_YEAR = $(year) And DB_WEEK = $(week);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 31);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 32);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 33);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 34);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 35);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 36);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 37);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store in QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, the select is about 125 lines with a lot of pre-calculation so I do not detail it here but I really need to calculate one week at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that after few call of the sub, the script quits with error. Number of call before error is not always the same... depends on the moon maybe ? &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;Did anyone face such thing before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hubert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Nov 2011 07:49:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-10T07:49:09Z</dc:date>
    <item>
      <title>Reload fails with error on End Sub</title>
      <link>https://community.qlik.com/t5/QlikView/Reload-fails-with-error-on-End-Sub/m-p/309133#M114127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a piece of script which is like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;connect to database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Load_DB(year, week)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_Table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load myField&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select ... From ... Where DB_YEAR = $(year) And DB_WEEK = $(week);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 31);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 32);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 33);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 34);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 35);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 36);&lt;/P&gt;&lt;P&gt;Call Load_DB(2010, 37);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store in QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, the select is about 125 lines with a lot of pre-calculation so I do not detail it here but I really need to calculate one week at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that after few call of the sub, the script quits with error. Number of call before error is not always the same... depends on the moon maybe ? &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;Did anyone face such thing before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hubert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 07:49:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reload-fails-with-error-on-End-Sub/m-p/309133#M114127</guid>
      <dc:creator />
      <dc:date>2011-11-10T07:49:09Z</dc:date>
    </item>
    <item>
      <title>Reload fails with error on End Sub</title>
      <link>https://community.qlik.com/t5/QlikView/Reload-fails-with-error-on-End-Sub/m-p/309134#M114128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I had a problem before when sometimes QV didn`t recognize the sub, but them none of them would work. &lt;/P&gt;&lt;P&gt; Can you change the sub, so qv will wait between two calls? (try including a sleep 100 before the end sub).&lt;/P&gt;&lt;P&gt;Another approach would be:&lt;/P&gt;&lt;P&gt;- Create a table with all the years and weeks you need to load, then you create a loop to read those records one by one and then you reprodure the code of your sub. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 18:14:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reload-fails-with-error-on-End-Sub/m-p/309134#M114128</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-11-11T18:14:25Z</dc:date>
    </item>
  </channel>
</rss>

