<?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: issues with incremental load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443168#M613053</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know if you are able to figure out the issue.&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;Regards,&lt;/P&gt;&lt;P&gt;Viresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Sep 2017 15:06:07 GMT</pubDate>
    <dc:creator>vireshkolagimat</dc:creator>
    <dc:date>2017-09-07T15:06:07Z</dc:date>
    <item>
      <title>issues with incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443165#M613050</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 have QVD file which was generated by SQL server database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i am generating the another QVD file from &lt;STRONG&gt;oracle database&lt;/STRONG&gt; (the table in oracle has the same structure like the table in SQL server) and trying to concatenate with the existing QVD file which was generated by the SQL server database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But after incremental load, its over writing the existing QVD file and keeping only the data which is from oracle database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest me how to to fix it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Viresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2017 08:36:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443165#M613050</guid>
      <dc:creator>vireshkolagimat</dc:creator>
      <dc:date>2017-09-06T08:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: issues with incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443166#M613051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the exact script you are using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2017 08:43:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443166#M613051</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-06T08:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: issues with incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443167#M613052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Setup for incremental load. */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vQvdFile='C:\Users\VireshK\Desktop\Migration\AB\Data\QVD\Raw_Qvds\ConsSalesHistory.qvd'; //?? The QVD filename &lt;/P&gt;&lt;P&gt;SET vTableName='SalesHistory'; //?? The name of the QV table we are loading on the Data Load tab&lt;/P&gt;&lt;P&gt;SET vPK='SalesHistoryId'; //?? Data Primary Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set a variable indicating if the QVD exists or not. -1 is True, 0 is False&lt;/P&gt;&lt;P&gt;LET vQvdExists = if(FileSize('$(vQvdFile)') &amp;gt; 0, -1, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(vQvdExists) THEN // QVD exists, we will do an incremental reload&lt;/P&gt;&lt;P&gt;maxdateTab:&lt;/P&gt;&lt;P&gt;// Get the max date from this QVD for use in incremental SELECT&lt;/P&gt;&lt;P&gt;LOAD max(InvoiceDate) as maxdate //?? Set the name of the date or datetime field&lt;/P&gt;&lt;P&gt;FROM $(vQvdFile) (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMaxdate = Date(Peek('maxdate',0,'maxdateTab'),'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;LET vLast30date = Date(Peek('maxdate',0,'maxdateTab')-30,'DD-MMM-YY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IsNull(vMaxdate) then&lt;/P&gt;&lt;P&gt;LET vIncrementalExpression = ''; &lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;// LET vIncrementalExpression = 'Where YEAR (salhist.dated) &amp;gt;= Year (GETDATE ()) - 3 and Convert(Varchar(8),salhist.dated, 112) &amp;gt;=' &amp;amp; Chr(39)&amp;amp; $(vLast30date) &amp;amp;Chr(39) &amp;amp;&lt;/P&gt;&lt;P&gt;LET vIncrementalExpression = 'and&amp;nbsp; CUSTOMERCODE not in (''L'',''M'',''N'') and InvoiceDate &amp;gt;=' &amp;amp; Chr(39)&amp;amp; '$(vLast30date)' &amp;amp;Chr(39) &amp;amp;&lt;/P&gt;&lt;P&gt;' and InvoiceDate &amp;lt;=' &amp;amp;Chr(39)&amp;amp; date(vReloadTime,'DD-MMM-YY') &amp;amp;Chr(39);&lt;/P&gt;&lt;P&gt;ENDIF;&lt;/P&gt;&lt;P&gt;DROP table maxdateTab;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE // QVD does not exist&lt;/P&gt;&lt;P&gt;//LET vIncrementalExpression = 'Where CUSTOMERCODE not in (''CCRE001'',''CCRE002'',''CNRE001'') and&amp;nbsp; YEAR(INVOICEDATE) &amp;gt;= (Year (sysdate()) - 3)'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LET vIncrementalExpression = 'and&amp;nbsp; CUSTOMERCODE not in (''L'',''M'',''N'') and extract( YEAR from InvoiceDate) &amp;gt;= (extract (YEAR from sysdate)-3)'; // No QVD. Force full reload &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* End of Setup for incremental load. */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;Load the incremental changes or full reload. &lt;/P&gt;&lt;P&gt;This is a standard LOAD (or SQL SELECT) statement.&amp;nbsp; &lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vTableName):&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD *;&lt;/P&gt;&lt;P&gt; SQL SELECT DIVISION_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; DIVISION_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; CUSTOMERCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WAREHOUSECODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PRODUCTCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; INVOICENO,&lt;/P&gt;&lt;P&gt;&amp;nbsp; INVOICEDATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESCOST,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESLISTVALUE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESCOMMISSION,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESCUSTOMERGROUP,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESTERRITORY,&lt;/P&gt;&lt;P&gt;&amp;nbsp; REGIONCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; CHANNELCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESMANCODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ROUTECODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESUNIT,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESUNITFACTOR,&lt;/P&gt;&lt;P&gt;&amp;nbsp; RETURNTYPE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESQTY,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SALESVALUE&lt;/P&gt;&lt;P&gt;FROM APPS.XXEGC_QV_SALES_HISTORY_V&amp;nbsp; &lt;/P&gt;&lt;P&gt;where DIVISION_CODE='A'&lt;/P&gt;&lt;P&gt;// If doing a SQL SELECT, the vIncrementalExpression would be part of the SQL SELECT statement. &lt;/P&gt;&lt;P&gt;$(vIncrementalExpression); // Include WHERE clause created in "Incremental Setup" tab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*End of Load*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;Update the QVD with changes.&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Directory C:\Users\VireshK\Desktop\Migration\AB\Data\QVD\Raw_Qvds;&lt;/P&gt;&lt;P&gt;// If incremental reload was , load previous data and concatenate to data just read.&lt;/P&gt;&lt;P&gt;IF $(vQvdExists) THEN&lt;/P&gt;&lt;P&gt;// Use CONCATENATE in case we've added any new fields.&lt;/P&gt;&lt;P&gt;CONCATENATE ($(vTableName)) &lt;/P&gt;&lt;P&gt;LOAD Distinct *&amp;nbsp; FROM $(vQvdFile) (qvd)&lt;/P&gt;&lt;P&gt;WHERE InvoiceDate &amp;lt; '$(vLast30date)'; // Load only QVD rows that were not already loaded in the data load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END IF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;Overwrite the QVD with the QV datatable. &lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;If ScriptErrorCount = 0 then&lt;/P&gt;&lt;P&gt;Call StoreAndDrop(vTableName,vQvdFile);&lt;/P&gt;&lt;P&gt;ENDIF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vQvdFile='';&lt;/P&gt;&lt;P&gt;SET vTableName='';&lt;/P&gt;&lt;P&gt;SET vPK='';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exit Script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2017 08:57:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443167#M613052</guid>
      <dc:creator>vireshkolagimat</dc:creator>
      <dc:date>2017-09-06T08:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: issues with incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443168#M613053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know if you are able to figure out the issue.&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;Regards,&lt;/P&gt;&lt;P&gt;Viresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 15:06:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issues-with-incremental-load/m-p/1443168#M613053</guid>
      <dc:creator>vireshkolagimat</dc:creator>
      <dc:date>2017-09-07T15:06:07Z</dc:date>
    </item>
  </channel>
</rss>

