<?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: Add records to table if Item reference does not exist in other table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543862#M686886</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give some example data?&amp;nbsp; It doesn't have to be your real data.&amp;nbsp; It's just so I can get an idea of what your data looks like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2014 15:05:33 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2014-01-02T15:05:33Z</dc:date>
    <item>
      <title>Add records to table if Item reference does not exist in other table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543861#M686885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi QlikView community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; First, Happy New Year to all of you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now, I come up with my question: I have a &lt;EM&gt;&lt;STRONG&gt;SalesPrices&lt;/STRONG&gt;&lt;/EM&gt; table in which I have the pricelist for the items we are selling. The relevant fields are these:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;ItemRef, StartingDate, EndDate, PriceListName, Price&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In my load script, I would need to append new records to this &lt;STRONG&gt;&lt;EM&gt;SalesPrices&lt;/EM&gt;&lt;/STRONG&gt; table. Those records need to be all those &lt;STRONG&gt;&lt;EM&gt;ItemRef &lt;/EM&gt;&lt;/STRONG&gt;that do not have a &lt;EM&gt;&lt;STRONG&gt;PriceListName &lt;/STRONG&gt;&lt;/EM&gt;between&lt;STRONG&gt; &lt;EM&gt;StartingDat&lt;/EM&gt;e&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;EndDate.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have thought about selecting all distinct &lt;STRONG&gt;&lt;EM&gt;PriceListName &lt;/EM&gt;&lt;/STRONG&gt;values in a separate table (let us name it &lt;EM&gt;&lt;STRONG&gt;TariffNames&lt;/STRONG&gt;&lt;/EM&gt;).&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For every &lt;STRONG&gt;ItemRef &lt;/STRONG&gt;in&lt;STRONG&gt; SalesPrices, &lt;/STRONG&gt;I need to check that every &lt;STRONG&gt;PriceListName &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/STRONG&gt;in&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt; TariffNames &lt;/STRONG&gt;exist in&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt; SalesPrices. For every non-existent PriceListName in SalesPrices,&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; I need to &lt;STRONG&gt;add a new record&lt;/STRONG&gt; in SalesPrices with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The ItemRef field,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2013 as StartingDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31/12/2013 as EndingDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PriceListName (non-existing one)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Price (zero value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How can I look for those non existing values and the &lt;STRONG&gt;TariffNames&lt;/STRONG&gt; table, and append those records to &lt;STRONG&gt;SalesPrices&lt;/STRONG&gt; table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Any help on this will be highly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 11:50:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543861#M686885</guid>
      <dc:creator>salto</dc:creator>
      <dc:date>2014-01-02T11:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add records to table if Item reference does not exist in other table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543862#M686886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give some example data?&amp;nbsp; It doesn't have to be your real data.&amp;nbsp; It's just so I can get an idea of what your data looks like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 15:05:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543862#M686886</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-02T15:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add records to table if Item reference does not exist in other table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543863#M686887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try Like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TempSalesPrices:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ItemRef, StartingDate, EndDate &lt;/EM&gt;From Source_SalesPrice.qvd (qvd);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Join (&lt;STRONG&gt;TempSalesPrices&lt;/STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD DISTINCT &lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;PriceListName &lt;STRONG&gt;From Source_SalesPrice.qvd (qvd)&lt;/STRONG&gt; ;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;STRONG&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ItemRef, StartingDate, EndDate&lt;/EM&gt;&lt;/STRONG&gt; , &lt;STRONG&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;PriceListName &lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;, Price &lt;STRONG&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;From Source_SalesPrice.qvd (qvd)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt; ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;SalesPrices&lt;/STRONG&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;STRONG&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ItemRef, StartingDate, EndDate&lt;/EM&gt;&lt;/STRONG&gt; , &lt;STRONG&gt;&lt;STRONG&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;PriceListName&lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt; , Alt(&lt;STRONG&gt;Price &lt;/STRONG&gt;,0) AS Price&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident &lt;STRONG&gt;TempSalesPrices&lt;/STRONG&gt; ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table &lt;STRONG&gt;&lt;STRONG&gt;TempSalesPrices&lt;/STRONG&gt; &lt;/STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 15:29:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543863#M686887</guid>
      <dc:creator />
      <dc:date>2014-01-02T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add records to table if Item reference does not exist in other table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543864#M686888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic. Many many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 11:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-records-to-table-if-Item-reference-does-not-exist-in-other/m-p/543864#M686888</guid>
      <dc:creator>salto</dc:creator>
      <dc:date>2014-01-03T11:05:04Z</dc:date>
    </item>
  </channel>
</rss>

