<?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: An error In script&amp;quot;Table Not found' in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317752#M825493</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;//store POS_Master_final into &lt;D&gt;;&lt;BR /&gt; &lt;/D&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;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; Temp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jul 2017 06:22:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-20T06:22:11Z</dc:date>
    <item>
      <title>An error In script"Table Not found'</title>
      <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317748#M825489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I am using a concatenate function with a qvd file that already exist to a table named increment sale, its giving error.why?&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/An-error-In-script-quot-Table-Not-found/m-p/1317748#M825489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: An error In script"Table Not found'</title>
      <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317749#M825490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the table view, if "increment sale" table is present there. if you have some table with same structure qlikivew automatically concatenate table and we are not able to find 2nd table in table viewer. &lt;/P&gt;&lt;P&gt;just to confirm you need to concatenate data in QVD with the already existing "increment sale" table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 11:15:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317749#M825490</guid>
      <dc:creator />
      <dc:date>2017-07-17T11:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: An error In script"Table Not found'</title>
      <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317750#M825491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Saksham!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be some case-sensitive things. Check that concateneted table name exactly as it is.&lt;/P&gt;&lt;P&gt;Or maybe you drop table after loading and then concatenate have no effect.&lt;/P&gt;&lt;P&gt;It will be usefull if you'll post your script too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 11:23:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317750#M825491</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2017-07-17T11:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: An error In script"Table Not found'</title>
      <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317751#M825492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share your script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 11:27:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317751#M825492</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-17T11:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: An error In script"Table Not found'</title>
      <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317752#M825493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;//store POS_Master_final into &lt;D&gt;;&lt;BR /&gt; &lt;/D&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;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; Temp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 06:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317752#M825493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-20T06:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: An error In script"Table Not found'</title>
      <link>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317753#M825494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure the table &lt;SPAN style="font-family: Courier New;"&gt;POS_Master_final&lt;/SPAN&gt; has been created before all of the script that you published above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Aug 2017 21:40:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-error-In-script-quot-Table-Not-found/m-p/1317753#M825494</guid>
      <dc:creator>NZFei</dc:creator>
      <dc:date>2017-08-07T21:40:57Z</dc:date>
    </item>
  </channel>
</rss>

