<?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: Insert and update based on condition (without timestamp). in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227174#M391515</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;Thank you Marcus!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;I really appreciate that you took some time helping me out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;-Olov&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2016 08:45:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-12-09T08:45:10Z</dc:date>
    <item>
      <title>Insert and update based on condition (without timestamp).</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227170#M391511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have encountered a problem when I am trying to write a script to one version of "Insert and Update" Incremental Load.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example: &lt;/STRONG&gt;To simplify the example I have made an illustration of how I want the data-set to update. (I leave the code for the discussion)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Example_Insert_And_Update.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146000_Example_Insert_And_Update.PNG" style="height: 208px; width: 620px; float: left;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example above you can see that I both want insert new records and to update records. The condition is that I only want to update records if the new value is greater than the existing record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, the existing record for ID 2 equals to 0 (Table 1) and since the new record for ID 2 equals to 100 (Table 2) I want to Update that record so the final updated record for ID 2 equals to the highest value of them two (Updated Table). If Table 2 contains a new record I just want to add that record to the final data-set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Insert new records&lt;/P&gt;&lt;P&gt;2. Update records if the value is higher than the existing record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you guys think is the best solution for this kind of problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olov&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 09:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227170#M391511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T09:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Insert and update based on condition (without timestamp).</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227171#M391512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer this post &lt;A href="https://community.qlik.com/docs/DOC-4597"&gt;Incremental Load&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 14:01:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227171#M391512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T14:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert and update based on condition (without timestamp).</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227172#M391513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand the idea with incremental load but this problem does not have a &lt;SPAN style="font-size: 10pt;"&gt;modification-date as described in the refered post.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 14:09:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227172#M391513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T14:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Insert and update based on condition (without timestamp).</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227173#M391514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t1:&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;ID, Value&lt;/P&gt;&lt;P&gt;1,500&lt;/P&gt;&lt;P&gt;2,0&lt;/P&gt;&lt;P&gt;3,100&lt;/P&gt;&lt;P&gt;4,300&lt;/P&gt;&lt;P&gt;5,0&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t2:&lt;/P&gt;&lt;P&gt;noconcatenate load * inline [&lt;/P&gt;&lt;P&gt;ID, Value&lt;/P&gt;&lt;P&gt;2,100&lt;/P&gt;&lt;P&gt;3,700&lt;/P&gt;&lt;P&gt;4,300&lt;/P&gt;&lt;P&gt;6,500&lt;/P&gt;&lt;P&gt;7,0&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t3:&lt;/P&gt;&lt;P&gt;noconcatenate load * resident t1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; join(t3)&lt;/P&gt;&lt;P&gt;load ID, Value as ValueN resident t2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t4:&lt;/P&gt;&lt;P&gt;noconcatenate load ID, rangemax(Value, ValueN) as Value resident t3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop tables t1, t2, t3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146078_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 19:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227173#M391514</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-12-08T19:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Insert and update based on condition (without timestamp).</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227174#M391515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;Thank you Marcus!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;I really appreciate that you took some time helping me out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: georgia, palatino;"&gt;-Olov&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 08:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-and-update-based-on-condition-without-timestamp/m-p/1227174#M391515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-09T08:45:10Z</dc:date>
    </item>
  </channel>
</rss>

