<?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: What is the functionality of incremental load ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425245#M800825</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi By using Incremental load, we can achieve different functionality based on requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;please refer following link to understand &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;A href="https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/" title="https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/"&gt;https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2017 07:31:56 GMT</pubDate>
    <dc:creator>prashantsanchet</dc:creator>
    <dc:date>2017-12-05T07:31:56Z</dc:date>
    <item>
      <title>What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425240#M800820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I have to execute incremental load but I want to know how incremental load works?&lt;/P&gt;&lt;P&gt;It overwrites the existing records?&lt;/P&gt;&lt;P&gt;or it adds all new records in the files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425240#M800820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425241#M800821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this could help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/" title="https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/"&gt;https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 06:19:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425241#M800821</guid>
      <dc:creator>luismadriz</dc:creator>
      <dc:date>2017-12-05T06:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425242#M800822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will load only new records based on the key field and then u need to concatenate it with old data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose u have \&lt;/P&gt;&lt;P&gt;ID,Salary&lt;/P&gt;&lt;P&gt;1,200&lt;/P&gt;&lt;P&gt;2,300&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have loaded the data.&lt;/P&gt;&lt;P&gt;If some more IDs are coming, suppose, ID =3,4,5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then u can use incremental load to load these IDs data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will load only data for these Ids=3,4,5 and then u need to concatenate Id=1,2 data into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a kind of best practice if u have large amount of data and u need to refresh QVD daily based on date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 06:43:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425242#M800822</guid>
      <dc:creator>shiveshsingh</dc:creator>
      <dc:date>2017-12-05T06:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425243#M800823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Thanks for sharing the link. Following is my script and I want to execute insert and update in incremental load.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;I have following tables&amp;nbsp; connected with sql &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;OLEDB&lt;/SPAN&gt; &lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;CONNECT&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;TO&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=ETPEAS;Data Source=192.168.1.70;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=QLIKVIEW;Use Encryption for Data=False;Tag with column collation when possible=False]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;XPassword&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; XEDJTZFMLB);&lt;BR /&gt; &lt;BR /&gt; Increment_Sales:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(POS_Master_final)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Warehouse&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;InvoiceNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[inv no]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CreateDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CreateDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CreateDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;InvoiceQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_sold&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesPrice&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[sales price]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;500, '&amp;lt;500', &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;800, '500-799',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1200, '800-1199',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1600,'1200-1599',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;2500,'1600-2499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;3500,'2500-3499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;5000,'3500-4999','&amp;gt;=5000'))))))) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Inv val Bucket]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;VatAmount&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[tax amount]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.CashOrderTrn&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;InvoiceType&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'31'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;(CreateDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;CreateDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)')&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ;&lt;BR /&gt; &lt;BR /&gt; Increment_Returns:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(POS_Master_final)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Warehouse&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesReturnNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[return no]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CreateDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CreateDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CreateDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ReturnItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ReturnItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ReturnQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_returns&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesPrice&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[sales price]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; -&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;500, '&amp;lt;500', &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;800, '500-799',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1200, '800-1199',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1600,'1200-1599',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;2500,'1600-2499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;3500,'2500-3499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;LocalAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;5000,'3500-4999','&amp;gt;=5000'))))))) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Inv val Bucket]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.SalesReturnTrn&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;InvoiceType&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'31'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;(CreateDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;CreateDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)')&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;&lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;//store POS_Master_final into &lt;D&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/D&gt;&lt;/EM&gt;&lt;/STRONG&gt;//This is an incremental file stored in qvd)&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;Inc&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;remental_Non_Etp_Sales:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(POS_Master_final)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;('SAPCODE_ETPCodeMapping',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,'') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;InvoiceNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[inv no]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;//'N_ETP SALE' as SaleType,&lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_sold&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;MRPValue&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[sales price]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;500, '&amp;lt;500', &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;800, '500-799',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1200, '800-1199',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1600,'1200-1599',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;2500,'1600-2499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;3500,'2500-3499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;5000,'3500-4999','&amp;gt;=5000'))))))) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Inv val Bucket]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;TaxAmount&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[tax amount]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQl&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;Select&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH.GoodsSender&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;NCode,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.InvoiceNumber,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate,SD.ItemNumber,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SaleQuantity,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.NetValue,SD.MRPValue,SD.TaxAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SAP_Link.dbo.Sales_DataNonETP_BIReports&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;INNER&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.warehouse_sap_bireport&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ON&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.CustomerId&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH.Warehouse&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;where&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.Doc_Type&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'ZIKE'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ;&lt;BR /&gt; &lt;BR /&gt; Incremental_Non_Etp_Returns:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(POS_Master_final)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;('SAPCODE_ETPCodeMapping',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,'') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;InvoiceNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[return no]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Month&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD')) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Sold_Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;//'N_ETP SALE' as SaleType,&lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_returns&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; -&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;MRPValue&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[sales price]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;500, '&amp;lt;500', &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;800, '500-799',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1200, '800-1199',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;1600,'1200-1599',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;2500,'1600-2499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;3500,'2500-3499',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &amp;lt;5000,'3500-4999','&amp;gt;=5000'))))))) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Inv val Bucket]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; -&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;TaxAmount&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[tax amount]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQl&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;Select&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH.GoodsSender&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;NCode,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.InvoiceNumber,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate,SD.ItemNumber,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SaleQuantity,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.NetValue,SD.MRPValue,SD.TaxAmount&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SAP_Link.dbo.Sales_DataNonETP_BIReports&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;INNER&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.warehouse_sap_bireport&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ON&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.CustomerId=WH.Warehouse&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;where&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.Doc_Type&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'ZIKR'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; Increment_Receiving_temp1:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;TOWarehouse&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CurrTransactionDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Received_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ReceivingNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[rec number]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ReceivedQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_received&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.DOLine&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WHERE(CurrTransactionDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;CurrTransactionDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)')&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ;&lt;BR /&gt; &lt;BR /&gt; Incremental_Receiving_Non_Etp:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; (Increment_Receiving_temp1)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;('SAPCODE_ETPCodeMapping',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,'') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Received_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;InvoiceNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[rec number]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_received&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; ;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQl&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;Select&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH.GoodsSender&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;NCode,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.InvoiceNumber,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate,SD.ItemNumber,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SaleQuantity&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SAP_Link.dbo.Sales_DataNonETP_BIReports&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;INNER&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.warehouse_sap_bireport&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ON&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.CustomerId=WH.Warehouse&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;where&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.Doc_Type&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'GR'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; Increment_Receiving_temp2:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; (Increment_Receiving_temp1)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Warehouse&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;CurrTransactionDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Received_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; -&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ReceivedQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_received&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.DOLine&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WHERE(CurrTransactionDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;CurrTransactionDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)')&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; ;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; Incremental_Receiving_Non_Etp_2:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; (Increment_Receiving_temp1)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;('SAPCODE_ETPCodeMapping',&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;NCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,'') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SalesDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, 'YYYYMMDD') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Received_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,' ','') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ItemNumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,3) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;InvoiceNumber&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[rec number]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; -&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;SaleQuantity&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_received&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; ;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;SQl&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;Select&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH.GoodsSender&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;NCode,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.InvoiceNumber,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate,SD.ItemNumber,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SaleQuantity&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SAP_Link.dbo.Sales_DataNonETP_BIReports&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;INNER&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ETPEAS.dbo.warehouse_sap_bireport&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;WH&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;ON&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.CustomerId=WH.Warehouse&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;where&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.Doc_Type&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'STN'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;'$(currentdate)'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;SD.SalesDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: lime;"&gt;20130101&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; Increment_Receiving_final:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;left&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; (Temp)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;ETPCode&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;itemnumber&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;[Season Code]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;quantity_received&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon;"&gt;Received_Date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Increment_Receiving_temp1;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;drop&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Increment_Receiving_temp1;&lt;BR /&gt; &lt;BR /&gt; Increment_Receiving_data:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(POS_Master_final)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; *&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Increment_Receiving_final;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;drop&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Increment_Receiving_final;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-family: 'Courier New';"&gt;drop&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;How to execute incremental load?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green;"&gt;//POS_Master:&lt;BR /&gt; //Load &lt;BR /&gt; //ETPCode,&lt;BR /&gt; //[inv no],&lt;BR /&gt; //Sold_Date,&lt;BR /&gt; //Sold_Month,&lt;BR /&gt; //Sold_Year,&lt;BR /&gt; //itemnumber,&lt;BR /&gt; //[Season Code],&lt;BR /&gt; //quantity_sold,&lt;BR /&gt; //[sales price],&lt;BR /&gt; //[inv value],&lt;BR /&gt; //[tax amount],&lt;BR /&gt; //[Inv val Bucket],&lt;BR /&gt; //[return no],&lt;BR /&gt; //quantity_returns&lt;BR /&gt; ////quantity_received,&lt;BR /&gt; ////First_Received_Date&lt;BR /&gt; //FROM&lt;BR /&gt; //D:\Data\Final QVD\Final\POS_Master_incremental.qvd (qvd)&lt;BR /&gt; //where Sold_Date &amp;lt;= MakeDate(2015,02,28) and NOT WildMatch(ETPCode,'*ETP*','N*N','N*');&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green;"&gt;/*&lt;BR /&gt; Last_Updated_Date:&lt;BR /&gt; load &lt;BR /&gt; max(Sold_Date) as Max_Date_Sales&lt;BR /&gt; RESIDENT POS_Master;&lt;BR /&gt; &lt;BR /&gt; Let Last_updated_Sales_date = DATE(peek('Max_Date_Sales',0,'Last_updated_Sales_date')+1,'YYYYMMDD');&lt;BR /&gt; */&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: green;"&gt;/*&lt;BR /&gt; &lt;BR /&gt; is this the way?&lt;/SPAN&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 06:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425243#M800823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-05T06:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425244#M800824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am refreshing my QVD where my data source is Oracle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempTable:&lt;/P&gt;&lt;P&gt;LOAD MAX(LAST_UPDATE_DATE) AS LUD &lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; [Lib://QVD/&amp;lt;QVDNAME&amp;gt;.qvd]&amp;nbsp; (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET MAX_LUD = Timestamp(peek('LUD')) ;&lt;/P&gt;&lt;P&gt;trace ($(MAX_LUD));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[oe_order_headers_all]:&lt;/P&gt;&lt;P&gt;SQL SELECT&amp;nbsp; HEADER_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LAST_UPDATE_DATE AS OOHA_LAST_UPDATE_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MORE COLUMNS&amp;gt;&lt;/P&gt;&lt;P&gt;FROM &amp;lt;TABLE NAME&amp;gt;&lt;/P&gt;&lt;P&gt;WHERE TO_DATE(TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM'),'mm/dd/yyyy hh:mi:ss AM') &amp;gt; TO_DATE('$(MAX_LUD)', 'mm/dd/yyyy hh:mi:ss AM');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * &lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; [Lib://QVD/&amp;lt;QVDNAME&amp;gt;.qvd] (qvd)&lt;/P&gt;&lt;P&gt;WHERE NOT Exists(HEADER_ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE oe_order_headers_all INTO [Lib://QVD/&amp;lt;QVDNAME&amp;gt;.qvd] (qvd);&lt;/P&gt;&lt;P&gt;Drop Table oe_order_headers_all;&lt;/P&gt;&lt;P&gt;Drop Table TempTable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 07:07:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425244#M800824</guid>
      <dc:creator>zahidrahim_ocp</dc:creator>
      <dc:date>2017-12-05T07:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425245#M800825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi By using Incremental load, we can achieve different functionality based on requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;please refer following link to understand &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;A href="https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/" title="https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/"&gt;https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 07:31:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425245#M800825</guid>
      <dc:creator>prashantsanchet</dc:creator>
      <dc:date>2017-12-05T07:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425246#M800826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so this code seems ok now, what problem are u getting in executing the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For getting the first value, u need to put 0 in the peek statement.&lt;/P&gt;&lt;P&gt;LET MAX_LUD = Timestamp(peek('LUD',0,'TempTable')) ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 08:21:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425246#M800826</guid>
      <dc:creator>shiveshsingh</dc:creator>
      <dc:date>2017-12-05T08:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425247#M800827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NO Problem. It is executing perfectly. Adding new records and updating existing one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If answer is correct please mark as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 08:48:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425247#M800827</guid>
      <dc:creator>zahidrahim_ocp</dc:creator>
      <dc:date>2017-12-05T08:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: What is the functionality of incremental load ?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425248#M800828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script will return only one row as max function is used and 0 in peek will return first row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 08:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-functionality-of-incremental-load/m-p/1425248#M800828</guid>
      <dc:creator>zahidrahim_ocp</dc:creator>
      <dc:date>2017-12-05T08:50:38Z</dc:date>
    </item>
  </channel>
</rss>

