<?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: Only reload QVW if condition is met, cancel if not in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361951#M134531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Idea was called "Exit script error code" in September 2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 May 2012 19:19:04 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-05-21T19:19:04Z</dc:date>
    <item>
      <title>Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361948#M134528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hoping someone can answer this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a QVW that pulls data from a SQL Datawarehouse (which gets populated from other sources via SSIS). &lt;/P&gt;&lt;P&gt;The document reloads via the QMC once an hour. However sometimes the Datawarehouse load from SSIS is still in progress when the QMC reload kicks off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is causing partial data to appear in the QVW.&amp;nbsp; To avoid this I have tried removing QMC from the equation and tried adding the load of the QVW to SSIS by using the command line prompt and a batch file. However this process kept hanging in the background and wasn't reliable enough&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some back to using the QMC to schedule reloads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ideally we want the QVW to only reload the data if the SSIS job has completed. If it hasn't completed, abort the reload and leave the QVW as is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is, it possible to have in the QVW script do something along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g Check a SQL table&amp;nbsp; to see if Job has completed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Completed &amp;gt; Execute the scripts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else Cancel Reload&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit QVW without Saving any changes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 16:07:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361948#M134528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-21T16:07:30Z</dc:date>
    </item>
    <item>
      <title>Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361949#M134529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've not tried this and it might save the qvw with no data (obviously not good) but try this at the top of your script after the settings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//assuming a 1 field, 1 row table in SQL populated by SSIS on completion&lt;/P&gt;&lt;P&gt;Check:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IsCompleted&lt;/P&gt;&lt;P&gt;; SQL SELECT IsCompleted From...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Peek('IsCompleted') &amp;lt;&amp;gt; 'Yes' THEN&lt;/P&gt;&lt;P&gt;Exit Script;&lt;/P&gt;&lt;P&gt;END IF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...Rest of script...&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;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 17:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361949#M134529</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-05-21T17:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361950#M134530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure that the qvw is never left in an empty state, what about:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;start with binary load. This must be the first line of the script.&lt;/LI&gt;&lt;LI&gt;check whether SSIS job is complete (eg if the job drops a file or updates a database table on completion).&lt;/LI&gt;&lt;LI&gt;If the job is not complete, terminate.&lt;/LI&gt;&lt;LI&gt;If the job is complete, drop all the tables and reload normally.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added an idea a while ago for the ability to trigger a user defined error in the script that would result in the same behaviour is a normal script error - ie the model gets reread from disk after an error. This would make this type of problem easy to solve - go to ideas and vote for it (I did it a while ago and cant remember what I called it!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 19:11:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361950#M134530</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-05-21T19:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361951#M134531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Idea was called "Exit script error code" in September 2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 19:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361951#M134531</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-05-21T19:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361952#M134532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are two ways to accomplish:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Trigger the QlikView server reload after the data warehouse is loaded from SSIS via EDX:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-wiki-small" href="http://community.qlik.com/docs/DOC-2650"&gt;http://community.qlik.com/docs/DOC-2650&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use a partial reload instead a (full resp normal) reload where all data remain in the QVW even if no additional data are loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 19:33:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361952#M134532</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-05-21T19:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361953#M134533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried the below but unfortunately it saves the document with no data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 15:22:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361953#M134533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-22T15:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361954#M134534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Will give this a try and let you know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 15:24:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361954#M134534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-22T15:24:11Z</dc:date>
    </item>
    <item>
      <title>Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361955#M134535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Hi Jonathan, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Thanks for the suggestion. The binary load worked along side Jason's suggestion&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;For info, the way I finally did it was&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;BinaryLoad the document in itself&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Pull Back Status of Job via SQL&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Use the IF Statement&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;IF TRUE then drop the Status table - this needs to be done to ensure the Binary Load doesn;t get changed&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Exit the Script&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;IF Not true the drop the tables that were loaded from the binary load&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;This loop works very well:&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;let numTables = NoOfTables();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;for i=1 to $(numTables)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;let tt = TableName(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;drop table [$(tt)];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;OL start="8"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Normal Reload Scripts&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 11pt;"&gt;Thanks for the help&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 14:00:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361955#M134535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T14:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Only reload QVW if condition is met, cancel if not</title>
      <link>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361956#M134536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jonathan. &lt;/P&gt;&lt;P&gt;Binary at first&lt;/P&gt;&lt;P&gt;then if condition=1 then &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;drop all the tables and reload &lt;/SPAN&gt;again&lt;/P&gt;&lt;P&gt;else exit script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is perfect !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 10:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-reload-QVW-if-condition-is-met-cancel-if-not/m-p/361956#M134536</guid>
      <dc:creator />
      <dc:date>2012-12-18T10:39:02Z</dc:date>
    </item>
  </channel>
</rss>

