<?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: update only current month records in incremental load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971199#M954007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should be pretty straightforward. You explanation says that all records are identified by way of a YYYYMM and a Name value. That should be your primary key. I guess the following series of steps should do what you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Load all updates for the current month in a new resident table. Create a PK field.&lt;/LI&gt;&lt;LI&gt;Load all inserts for the current month into the same table on condition that their PK doesn't exist yet. Add a PK value to those records.&lt;/LI&gt;&lt;LI&gt;Load all history rows from the QVD into the same resident table except those whose PK already exists in the resident table.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end, and before storing your resulting table, you can drop the PK field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Nov 2015 10:21:32 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-11-24T10:21:32Z</dc:date>
    <item>
      <title>update only current month records in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971197#M954005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a script which is trying to update only current month data based on data available on daily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one QVD file, insert and update files. If I run script it should update only current month records, if anything is update. If the records available in previous month it should not update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets take i have QVD with the following data.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Qvd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Id&amp;nbsp; Name&amp;nbsp;&amp;nbsp; date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;1&amp;nbsp;&amp;nbsp; Kp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201510&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp; Pete&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201510&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp; Mike&amp;nbsp;&amp;nbsp;&amp;nbsp; 201511&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an excel file with the data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;updates:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #008000;"&gt;Id&amp;nbsp;&amp;nbsp; Name date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; Kp1&amp;nbsp;&amp;nbsp;&amp;nbsp; 201511&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;inserts:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Id&amp;nbsp; Name date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp; juke&amp;nbsp;&amp;nbsp; 201511&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my final QVd should be like below.&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008000;"&gt;Id&amp;nbsp; Name&amp;nbsp;&amp;nbsp; date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; Kp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201510&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp; Pete&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201510&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp; Mike&amp;nbsp;&amp;nbsp;&amp;nbsp; 201511&lt;/P&gt;&lt;P&gt;4&amp;nbsp; juke&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201511&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;1&amp;nbsp; kp1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201511&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have to update only current month records not previous month records. As I highlighted in red color. Kp is available in 201510 and 201511. It should be available in previous month and this month as well. If the same id update in December it should available in 3 months as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have written below script, but it is not working&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;updates:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD id, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amount, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;account_updates.xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where Month(date)&amp;lt;&amp;gt;Month(today());&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If FileSize('12.qvd') &amp;gt; 0 then&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD *&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM D:\insertsupdates\12.QVD(qvd)&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOT Exists(id);&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Concatenate(updates)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD id, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;account_inserts.xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; where not Exists(id);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STORE updates into D:\insertsupdates\12.QVD(qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Pls help me on this one.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 09:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971197#M954005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T09:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: update only current month records in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971198#M954006</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;Please chk below link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-9531" title="https://community.qlik.com/docs/DOC-9531"&gt;https://community.qlik.com/docs/DOC-9531&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 10:07:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971198#M954006</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2015-11-24T10:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: update only current month records in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971199#M954007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should be pretty straightforward. You explanation says that all records are identified by way of a YYYYMM and a Name value. That should be your primary key. I guess the following series of steps should do what you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Load all updates for the current month in a new resident table. Create a PK field.&lt;/LI&gt;&lt;LI&gt;Load all inserts for the current month into the same table on condition that their PK doesn't exist yet. Add a PK value to those records.&lt;/LI&gt;&lt;LI&gt;Load all history rows from the QVD into the same resident table except those whose PK already exists in the resident table.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end, and before storing your resulting table, you can drop the PK field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 10:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971199#M954007</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-11-24T10:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: update only current month records in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971200#M954008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a small doubt here and already having PK as Id in my table. Please tell is it require to create another PK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't mind can you modify my script which I have pasted in my earlier post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 11:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971200#M954008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T11:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: update only current month records in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971201#M954009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your original PK is not a PK because it doesn't uniquely identify rows. Moreover, a composite key (Name and YYYYMM) will simplify considerably the check for existing rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new PK has to be created only during the two small LOADs (1 and 2). during step 3, you only check for existence of every historic value as you do not want the history to overwrite the new updates. After that you can throw away the temporary PK. So no need to store it in the QVD that you may want to STORE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 11:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/update-only-current-month-records-in-incremental-load/m-p/971201#M954009</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-11-24T11:15:25Z</dc:date>
    </item>
  </channel>
</rss>

