<?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: Insert, update and delete in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Incremental-Load-Insert-update-and-delete/m-p/1916586#M75446</link>
    <description>&lt;P&gt;Hi, you'll need a unique key, a unique key can be created with a combination of hte different primary keys as:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;QV_Table:
LOAD *, PrimaryKey1&amp;amp;'_'&amp;amp;PrimaryKey2 as UniqueKey;
SQL SELECT PrimaryKey1, PrimaryKey2, X, Y FROM DB_TABLE&lt;/LI-CODE&gt;
&lt;P&gt;And check exists as&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD PrimaryKey1, PrimaryKey2 X, Y FROM File.QVD
WHERE NOT EXISTS('UniqueKey',PrimaryKey1&amp;amp;'_'&amp;amp;PrimaryKey2);&lt;/LI-CODE&gt;
&lt;P&gt;After this you can do a "DROP Field UniqueKey;"&lt;/P&gt;</description>
    <pubDate>Sun, 10 Apr 2022 07:34:19 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2022-04-10T07:34:19Z</dc:date>
    <item>
      <title>Incremental Load: Insert, update and delete</title>
      <link>https://community.qlik.com/t5/App-Development/Incremental-Load-Insert-update-and-delete/m-p/1912811#M75248</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I am currently having problems with the development of the script to carry out an incremental load from a BBDD to a QVD.&lt;BR /&gt;I am using the information that Qlik makes available on the topic: Isert, update and delete (&lt;A href="https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;The solution proposed in the help page works for tables that have only one primary key.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to implement this solution on tables with 2 primary keys or more but I don't get the expected result.&lt;BR /&gt;Has anyone implemented a script for incremental loading of tables with two or more primary keys?&lt;/P&gt;
&lt;P&gt;My&amp;nbsp;script looks something like this:&lt;/P&gt;
&lt;P&gt;Let ThisExecTime = Now( );&lt;/P&gt;
&lt;P&gt;QV_Table:&lt;/P&gt;
&lt;P&gt;SQL SELECT PrimaryKey1, PrimaryKey2, X, Y FROM DB_TABLE&lt;/P&gt;
&lt;P&gt;WHERE ModificationTime &amp;gt;= #$(LastExecTime)#&lt;/P&gt;
&lt;P&gt;AND ModificationTime &amp;lt; #$(ThisExecTime)#;&lt;/P&gt;
&lt;P&gt;Concatenate&lt;/P&gt;
&lt;P&gt;LOAD PrimaryKey1, PrimaryKey2 X, Y FROM File.QVD&lt;/P&gt;
&lt;P&gt;WHERE NOT EXISTS(PrimaryKey1) AND NOT EXIST(PrimaryKey2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inner Join SQL SELECT PrimaryKey1, PrimaryKey2 FROM DB_TABLE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If ScriptErrorCount = 0 then&lt;/P&gt;
&lt;P&gt;STORE QV_Table INTO File.QVD;&lt;/P&gt;
&lt;P&gt;Let LastExecTime = ThisExecTime;&lt;/P&gt;
&lt;P&gt;End If&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 22:43:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incremental-Load-Insert-update-and-delete/m-p/1912811#M75248</guid>
      <dc:creator>Alex2310</dc:creator>
      <dc:date>2022-03-31T22:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental Load: Insert, update and delete</title>
      <link>https://community.qlik.com/t5/App-Development/Incremental-Load-Insert-update-and-delete/m-p/1916586#M75446</link>
      <description>&lt;P&gt;Hi, you'll need a unique key, a unique key can be created with a combination of hte different primary keys as:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;QV_Table:
LOAD *, PrimaryKey1&amp;amp;'_'&amp;amp;PrimaryKey2 as UniqueKey;
SQL SELECT PrimaryKey1, PrimaryKey2, X, Y FROM DB_TABLE&lt;/LI-CODE&gt;
&lt;P&gt;And check exists as&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD PrimaryKey1, PrimaryKey2 X, Y FROM File.QVD
WHERE NOT EXISTS('UniqueKey',PrimaryKey1&amp;amp;'_'&amp;amp;PrimaryKey2);&lt;/LI-CODE&gt;
&lt;P&gt;After this you can do a "DROP Field UniqueKey;"&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2022 07:34:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incremental-Load-Insert-update-and-delete/m-p/1916586#M75446</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2022-04-10T07:34:19Z</dc:date>
    </item>
  </channel>
</rss>

