<?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 WaitForIdle or Sleep in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/WaitForIdle-or-Sleep/m-p/556678#M207809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's take a look into documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sleep - Pauses QlikView for a specified time. &lt;/P&gt;&lt;P&gt;WaitForIdle - Holds macro execution until all layout entities have been updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of them are for pausing your application. I used to use WaitForIdle, but today I've got very strange behavior. I'm using QV for aggregation and exporting data into Excel files, like this:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13817783069408735" jivemacro_uid="_13817783069408735" modifiedtitle="true"&gt;
&lt;P&gt;set obj = ActiveDocument.GetSheetObject("CH01")&lt;/P&gt;
&lt;P&gt;... loop start ...&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... doing some selections ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.ExportBiff "C:\test.xls"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;
&lt;P&gt;... loop end ...&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I do this in a loop. When an Excel file is not so big, it works fine. But if the file is huge, like 10 tabs with 65,536 records in each, the Excel saving time is longer then WaitForIdle (so, QV is faster &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;), then my dashboard is just sticking. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I've replaced WaitForIdle by &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ActiveDocument.GetApplication.Sleep 60000*5 and it works fine with even big files.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Resume, WaitForIdle has no idea for any background QV processes. It's doing exactly what it is said in the documentation - 'Holds macro execution until all LAYOUT entities have been updated.' If there is no any layout changes (my chart object is minimized), your application will not pause at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Oct 2013 19:42:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-14T19:42:05Z</dc:date>
    <item>
      <title>WaitForIdle or Sleep</title>
      <link>https://community.qlik.com/t5/QlikView/WaitForIdle-or-Sleep/m-p/556678#M207809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's take a look into documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sleep - Pauses QlikView for a specified time. &lt;/P&gt;&lt;P&gt;WaitForIdle - Holds macro execution until all layout entities have been updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of them are for pausing your application. I used to use WaitForIdle, but today I've got very strange behavior. I'm using QV for aggregation and exporting data into Excel files, like this:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13817783069408735" jivemacro_uid="_13817783069408735" modifiedtitle="true"&gt;
&lt;P&gt;set obj = ActiveDocument.GetSheetObject("CH01")&lt;/P&gt;
&lt;P&gt;... loop start ...&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... doing some selections ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.ExportBiff "C:\test.xls"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;
&lt;P&gt;... loop end ...&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I do this in a loop. When an Excel file is not so big, it works fine. But if the file is huge, like 10 tabs with 65,536 records in each, the Excel saving time is longer then WaitForIdle (so, QV is faster &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;), then my dashboard is just sticking. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I've replaced WaitForIdle by &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ActiveDocument.GetApplication.Sleep 60000*5 and it works fine with even big files.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Resume, WaitForIdle has no idea for any background QV processes. It's doing exactly what it is said in the documentation - 'Holds macro execution until all LAYOUT entities have been updated.' If there is no any layout changes (my chart object is minimized), your application will not pause at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 19:42:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WaitForIdle-or-Sleep/m-p/556678#M207809</guid>
      <dc:creator />
      <dc:date>2013-10-14T19:42:05Z</dc:date>
    </item>
  </channel>
</rss>

