<?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 Checking for new data in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535993#M691796</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm struggling to write a script that will help me check for new data in my data source.&lt;/P&gt;&lt;P&gt;My setup currently runs every half an hour to refresh data come hell or high water (I would like this to be a shorter period ideally. High/immediate data availability is a requirement of this system). This is obviously resource intensive, hammers the database as well as my QV server. The job takes about 6 minutes to run. I have Publisher set up and the completion of my QVD creator script triggers my application rebuilding. There is clearly no point in all this running on the dot every half an hour if there is no new data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I require is the following:&lt;/P&gt;&lt;P&gt;- My QVD creator script checks a field in the database (we have audit logs noting when data has changed)&lt;/P&gt;&lt;P&gt;- This is compared to a field saved into a QVD used to store the last load.&lt;/P&gt;&lt;P&gt;- If there is more recent data, run the script to import the new data, otherwise exit the whole job gracefully, including the application refresh&lt;/P&gt;&lt;P&gt;NB this is not an incremental load, although similar. The data is replaced completely rather than incrementally changed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bit I'm struggling with here is the syntax of my If statement - how to compare the different dates, how to handle dates in variables etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Aug 2013 12:37:13 GMT</pubDate>
    <dc:creator>justin_morley</dc:creator>
    <dc:date>2013-08-27T12:37:13Z</dc:date>
    <item>
      <title>Checking for new data in script</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535993#M691796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm struggling to write a script that will help me check for new data in my data source.&lt;/P&gt;&lt;P&gt;My setup currently runs every half an hour to refresh data come hell or high water (I would like this to be a shorter period ideally. High/immediate data availability is a requirement of this system). This is obviously resource intensive, hammers the database as well as my QV server. The job takes about 6 minutes to run. I have Publisher set up and the completion of my QVD creator script triggers my application rebuilding. There is clearly no point in all this running on the dot every half an hour if there is no new data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I require is the following:&lt;/P&gt;&lt;P&gt;- My QVD creator script checks a field in the database (we have audit logs noting when data has changed)&lt;/P&gt;&lt;P&gt;- This is compared to a field saved into a QVD used to store the last load.&lt;/P&gt;&lt;P&gt;- If there is more recent data, run the script to import the new data, otherwise exit the whole job gracefully, including the application refresh&lt;/P&gt;&lt;P&gt;NB this is not an incremental load, although similar. The data is replaced completely rather than incrementally changed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bit I'm struggling with here is the syntax of my If statement - how to compare the different dates, how to handle dates in variables etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 12:37:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535993#M691796</guid>
      <dc:creator>justin_morley</dc:creator>
      <dc:date>2013-08-27T12:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for new data in script</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535994#M691797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Justin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use an Incremetal Load. The standard way it is done in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your table needs to have a Primary Key as well as a field that has a date time stamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everytime the job runs it will pick the fresh records only. There are various scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see whitepaper that has the details of how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 12:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535994#M691797</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-08-27T12:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for new data in script</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535995#M691798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;Thanks for your reply. In truth I've been deliberately avoiding using incremental load due to the complexity of the underlying data - the main data souce is an Oracle database&amp;nbsp; containing 20 materialised views built on &amp;gt;130 tables, and propagating the modification date to that lot is no mean task! It's probably time to bite the bullet and finally implement incremental load... Can anybody help me with these follow-on questions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;As everything hangs off a single table at the top of my data hierarchy, is there a efficient way to&amp;nbsp; avoid having to attach a modified date to every table?&lt;/LI&gt;&lt;LI&gt;My second question above isn't answered by any of the documentation I've seen about implementing incremental load. If no changes are made to the tables, what's the best way to prevent execution of the triggered job to build my app? Throw an "exception" somehow to bring down the job?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 09:44:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535995#M691798</guid>
      <dc:creator>justin_morley</dc:creator>
      <dc:date>2013-08-28T09:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for new data in script</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535996#M691799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to Dave Denscombe from QlikTech for emailing me offline this list of suggestions for handling cancelling the rebuild job:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="color: #1f497d;"&gt;The forced failure (i.e. pretending to throw an exception. see here &lt;A href="https://community.qlik.com/thread/8584"&gt;How to interrupt reload and throw error if field is empty?&lt;/A&gt;) is an option but a bit “yuk” as you say&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #1f497d;"&gt;Another would be very old fashioned, write out a dummy file which the downstream application&lt;BR /&gt;picks up to make the decision&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #1f497d;"&gt;Alternatively, set up the downstream application using an EDX trigger.&amp;nbsp; The first script if&lt;BR /&gt;there is something to do calls the EDX command line tool to start the second&lt;BR /&gt;job&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I shall&amp;nbsp; investigate the EDX option which seems 'least worst'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 10:23:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-new-data-in-script/m-p/535996#M691799</guid>
      <dc:creator>justin_morley</dc:creator>
      <dc:date>2013-08-29T10:23:23Z</dc:date>
    </item>
  </channel>
</rss>

