<?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: Incremental Load with WHERE NOT EXISTS()  - QVD files in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197195#M22592</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is the obvious: should be EXISTS not EXIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, examine the ID values in Table and compare to the ID values in the QVD. Perhaps they are not the same (spaces on the end or front).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Oct 2016 16:35:21 GMT</pubDate>
    <dc:creator>m_woolf</dc:creator>
    <dc:date>2016-10-03T16:35:21Z</dc:date>
    <item>
      <title>Incremental Load with WHERE NOT EXISTS()  - QVD files</title>
      <link>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197194#M22591</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 am trying to do an incremental load from an SQL Server 2008 database, and an existing QVD file. I have copied the syntax from here. I am trying to do an INSERT with UPDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/1.1/Subsystems/Hub/Content/LoadData/UsingQVDFilesIncrementalLoad.htm" title="https://help.qlik.com/en-US/sense/1.1/Subsystems/Hub/Content/LoadData/UsingQVDFilesIncrementalLoad.htm"&gt;https://help.qlik.com/en-US/sense/1.1/Subsystems/Hub/Content/LoadData/UsingQVDFilesIncrementalLoad.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running into an issue with WHERE NOT EXISTS(). My load scripts looks as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_name:&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value2&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UpdateTime &amp;gt;= '$(LastUpdateTime)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value2&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [lib://MyQVD/Table_name.qvd](qvd)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS(ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE Table_name INTO [lib://QVD/Table_name.qvd](qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know for a fact that Table_name returned from the database contains 23 records. I first created the QVD file by omitting the CONCATENATE portion of the above script and successfully stored all 23 records in the QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when I include the CONCATENATE, and run the load script again, it loads all 23 rows from the QVD file, even though I know for a fact that the primary key ID exists in the first set loaded from the SQL script. This leads me to believe that there is either a problem with my WHERE clause, or the EXISTS() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also sometimes get the script to return a strange number of rows from the QVD. I've run the above script and know that the SQL server has returned 0 rows, however the CONCATENATE LOAD portion will strangely read 7 rows from the QVD file, where it should actually be reading 23 rows in this instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perhaps I don't understand how the EXISTS() function works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the QVD files with Qlik Sense 3.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jesse&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Oct 2016 06:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197194#M22591</guid>
      <dc:creator />
      <dc:date>2016-10-02T06:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental Load with WHERE NOT EXISTS()  - QVD files</title>
      <link>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197195#M22592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is the obvious: should be EXISTS not EXIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, examine the ID values in Table and compare to the ID values in the QVD. Perhaps they are not the same (spaces on the end or front).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 16:35:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197195#M22592</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2016-10-03T16:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental Load with WHERE NOT EXISTS()  - QVD files</title>
      <link>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197196#M22593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've updated the above example to EXISTS(), which is what is actually in my load script. Just a typo in the post. Thanks for pointing that out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ID's are exactly the same, no leading or trailing spaces. All PKs are integers as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jesse&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 18:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incremental-Load-with-WHERE-NOT-EXISTS-QVD-files/m-p/1197196#M22593</guid>
      <dc:creator />
      <dc:date>2016-10-03T18:24:47Z</dc:date>
    </item>
  </channel>
</rss>

