<?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 Help with first go at incremental loads and updates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-first-go-at-incremental-loads-and-updates/m-p/602777#M684018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I am working on improving our dataset from the last 3 full months to last 12 full months of incidents and decided to go the incremental load and update route.&amp;nbsp; I am struggling with a few things though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I did the initial load:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13927617949135593" jivemacro_uid="_13927617949135593"&gt;
&lt;P&gt;Inc_Table:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt;&lt;/SPAN&gt; incident.number as incident_number,&lt;/P&gt;
&lt;P&gt;incident.data_updated as data_updated&lt;/P&gt;
&lt;P&gt;FROM tbl_incident incident&lt;/P&gt;
&lt;P&gt;WHERE&lt;/P&gt;
&lt;P&gt;incident.opened_at &amp;gt;= convert(varchar(10),dateadd(mm,-12,dateadd(dd,-(day(getdate())-1),getdate())),101);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;STORE&lt;/STRONG&gt;&lt;/SPAN&gt; Inc_Table &lt;SPAN class="s1"&gt;INTO&lt;/SPAN&gt; incidents.QVD;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1" style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2" style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;&lt;EM&gt;LastExecTime&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s1" style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;now&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the initial load I added the below code to my WHERE statement for Inc_Table query.&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="_jivemacro_uid_13927617949103588 jive_text_macro jive_macro_code" jivemacro_uid="_13927617949103588"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;and incident.data_updated &amp;gt;= '$(LastExecTime)'&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I added the below concatenate between Inc_Table populate and STORE (before store in order to concat old records where incident_number doesn't exist in the new Inc_Table, correct?)&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13927617948926187" jivemacro_uid="_13927617948926187"&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;Concatenate&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;incident_number&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="s2"&gt;data_updated&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;[incidents.QVD]&lt;/P&gt;
&lt;P&gt;(&lt;SPAN class="s1"&gt;qvd&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;EXISTS&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;incident_number&lt;/SPAN&gt;);&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, where do I need help:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Inc_Table query is fetching a number of rows that is no where near what it should.&amp;nbsp; I've tested the query with a manually typed LastExecTime using DBArtisan and I get ~40 rows which is accurate but Qlikview always returns ~1,300 lines fetched.&amp;nbsp; No idea what is going on with this.&amp;nbsp; Assuming something with LastExecTime.&lt;/LI&gt;&lt;LI&gt;How do I change my data_updated to query max data_updated from QVD and is that a better way to do it?&lt;/LI&gt;&lt;LI&gt;Also, is the method I am using correct to query newly updated records and merge with QVD records?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Feb 2014 22:08:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-02-18T22:08:57Z</dc:date>
    <item>
      <title>Help with first go at incremental loads and updates</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-first-go-at-incremental-loads-and-updates/m-p/602777#M684018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I am working on improving our dataset from the last 3 full months to last 12 full months of incidents and decided to go the incremental load and update route.&amp;nbsp; I am struggling with a few things though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I did the initial load:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13927617949135593" jivemacro_uid="_13927617949135593"&gt;
&lt;P&gt;Inc_Table:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt;&lt;/SPAN&gt; incident.number as incident_number,&lt;/P&gt;
&lt;P&gt;incident.data_updated as data_updated&lt;/P&gt;
&lt;P&gt;FROM tbl_incident incident&lt;/P&gt;
&lt;P&gt;WHERE&lt;/P&gt;
&lt;P&gt;incident.opened_at &amp;gt;= convert(varchar(10),dateadd(mm,-12,dateadd(dd,-(day(getdate())-1),getdate())),101);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;STORE&lt;/STRONG&gt;&lt;/SPAN&gt; Inc_Table &lt;SPAN class="s1"&gt;INTO&lt;/SPAN&gt; incidents.QVD;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1" style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2" style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;&lt;EM&gt;LastExecTime&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; = &lt;/SPAN&gt;&lt;SPAN class="s1" style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;now&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the initial load I added the below code to my WHERE statement for Inc_Table query.&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="_jivemacro_uid_13927617949103588 jive_text_macro jive_macro_code" jivemacro_uid="_13927617949103588"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;and incident.data_updated &amp;gt;= '$(LastExecTime)'&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I added the below concatenate between Inc_Table populate and STORE (before store in order to concat old records where incident_number doesn't exist in the new Inc_Table, correct?)&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13927617948926187" jivemacro_uid="_13927617948926187"&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;Concatenate&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;incident_number&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="s2"&gt;data_updated&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;[incidents.QVD]&lt;/P&gt;
&lt;P&gt;(&lt;SPAN class="s1"&gt;qvd&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;EXISTS&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;incident_number&lt;/SPAN&gt;);&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, where do I need help:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Inc_Table query is fetching a number of rows that is no where near what it should.&amp;nbsp; I've tested the query with a manually typed LastExecTime using DBArtisan and I get ~40 rows which is accurate but Qlikview always returns ~1,300 lines fetched.&amp;nbsp; No idea what is going on with this.&amp;nbsp; Assuming something with LastExecTime.&lt;/LI&gt;&lt;LI&gt;How do I change my data_updated to query max data_updated from QVD and is that a better way to do it?&lt;/LI&gt;&lt;LI&gt;Also, is the method I am using correct to query newly updated records and merge with QVD records?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 22:08:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-first-go-at-incremental-loads-and-updates/m-p/602777#M684018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-18T22:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with first go at incremental loads and updates</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-first-go-at-incremental-loads-and-updates/m-p/602778#M684019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check out the attached folder. It has a file with a working example and explanation of how incremental load should be coded/used.Thanks to &lt;A href="https://community.qlik.com/qlik-users/2286"&gt;Rob Wunderlich&lt;/A&gt; for sharing this.&lt;/P&gt;&lt;P&gt;This should answer all your questions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 22:54:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-first-go-at-incremental-loads-and-updates/m-p/602778#M684019</guid>
      <dc:creator />
      <dc:date>2014-02-18T22:54:56Z</dc:date>
    </item>
  </channel>
</rss>

