<?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 Loading from a Resident table into a Resident Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372354#M138440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yep, knew it was something obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2012 14:29:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-27T14:29:27Z</dc:date>
    <item>
      <title>Loading from a Resident table into a Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372352#M138438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having an issue where i have to load from a Resident Table using an if statement to create new fields. Creating the new fields is fine but i can't join them back to the original table without creating duplicate rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Code is as follows;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DRSALES:&lt;BR /&gt;LOAD [Invoice Number],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Number],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Item Code] as [Item Code],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice Number] &amp;amp; '-' &amp;amp; [Item Code] as [Credit Line Identifier], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Quantity Invoiced],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Item Major],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Item Minor],&amp;nbsp; &lt;BR /&gt;FROM&lt;BR /&gt;&lt;X&gt;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;WHERE [Item Minor] &amp;lt;&amp;gt; 'CAT' &lt;BR /&gt;OR [Customer Code] &amp;lt;&amp;gt; 'FOCCC' &lt;BR /&gt;OR [Quantity Invoiced] &amp;lt;&amp;gt; 0 //To exclude double counting where customer uses consolidated invoices&lt;BR /&gt;OR NOT IsNull([Invoice Number])&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//DRSALES2//&lt;BR /&gt;//This shows Credits Detail&lt;BR /&gt;Join LOAD [Invoice Number], &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Transaction Type],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Credit Reason],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice Value], &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice Charges]&lt;BR /&gt;FROM&lt;BR /&gt;&lt;X&gt;&lt;BR /&gt;(qvd)&lt;BR /&gt;;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;//If A Return has been raised and not JUST as a Credit, the Order Number Field will show a Returns Numbers Rather than the Original Invoice number (confusing I know!!)&lt;/P&gt;&lt;P&gt;OriginalReturnsNos:&lt;BR /&gt;Join LOAD &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Original invoice number] &amp;amp; '-' &amp;amp; [Item code] as [Credit Line Identifier],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Return number] &amp;amp; '-' &amp;amp; [Item code] as [Return Line Identifier]&lt;BR /&gt;FROM&lt;BR /&gt;[..\..\..\..\Data\File_Extracts\System21_Extracts\QLKRETURNS.CSV]&lt;BR /&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;BR /&gt;Where Exists([Order Number],[Return number])&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This Creates a field called CreditLineID which holds the Return Line Identifier (Return number &amp;amp; Item Code) or if that doesn't exist, &lt;BR /&gt;// the Credit Line Identifier (Invoice number &amp;amp; Item Code). The 2 fields are then dropped and the CreditLineID field is then used to link back to the Credit Lines when they're reloaded in table Credit Transactions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HERE IS THE BIT THAT DOESN'T WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, now that the Original Return Numbers table has been loaded into DRSALES, i need to do an if statement (as below) to create a field and then load that back into DRSALES. Heres the code im using.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Left Join(DRSALES)&lt;BR /&gt;Load&lt;BR /&gt;[Credit Line Identifier],&lt;BR /&gt;If(IsNull([Return Line Identifier]),[Credit Line Identifier],[Return Line Identifier]) as CreditLineID,&lt;BR /&gt;If(IsNull([Line Value]) AND IsNull([Line Cost]) AND [Invoice Charges] &amp;gt; 0, 'Consolidated Invoice',null()) as [Consolidated Check]&lt;BR /&gt;Resident DRSALES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this duplicates row (as seen by the frequency of 1 invoice increasing from 3,000 to 200,000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am i missing something really obvious?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 13:14:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372352#M138438</guid>
      <dc:creator />
      <dc:date>2012-04-27T13:14:12Z</dc:date>
    </item>
    <item>
      <title>Loading from a Resident table into a Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372353#M138439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use Load Distinct when you think could be duplicate rows. Could you check if something changes using Distinct??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372353#M138439</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-04-27T14:03:13Z</dc:date>
    </item>
    <item>
      <title>Loading from a Resident table into a Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372354#M138440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yep, knew it was something obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:29:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372354#M138440</guid>
      <dc:creator />
      <dc:date>2012-04-27T14:29:27Z</dc:date>
    </item>
    <item>
      <title>Loading from a Resident table into a Resident Table</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372355#M138441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It´s a pleasure could be usefull,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-a-Resident-table-into-a-Resident-Table/m-p/372355#M138441</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-04-27T14:31:20Z</dc:date>
    </item>
  </channel>
</rss>

