<?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: deleting record from previous table during load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658145#M1076235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt; Let me know if this works:&lt;/P&gt;&lt;P&gt;Message_inline:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[Message&lt;/P&gt;&lt;P&gt;D1];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NMDS:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load*&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[..\..\8.Import\0.NMDS\2013\*.txt]&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where exists(Message);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Continue to use &lt;STRONG&gt;where exists()&lt;/STRONG&gt; function on all your files. This will ensure that only records relevant to D1 are loaded and rest are ignored. Flagging them is a bigger problem. Avoiding records is easier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Jul 2014 20:59:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-26T20:59:20Z</dc:date>
    <item>
      <title>deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658144#M1076233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have several hundred files to load all with the exact same fields. I am currently using:&lt;/P&gt;&lt;P&gt;NMDS:&lt;/P&gt;&lt;P&gt;Load*&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\..\8.Import\0.NMDS\2013\*.txt]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One requirement is to look for 'D1' records in the 'Message' Field. If it finds a 'D1' record then i need to search the records i have loaded so far for the matching Primary Key and Delete (or Flag) the matching record that has previously been loaded. Any suggestions on how this could be achieved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 07:17:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658144#M1076233</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-07-26T07:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658145#M1076235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt; Let me know if this works:&lt;/P&gt;&lt;P&gt;Message_inline:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[Message&lt;/P&gt;&lt;P&gt;D1];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NMDS:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load*&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[..\..\8.Import\0.NMDS\2013\*.txt]&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where exists(Message);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Continue to use &lt;STRONG&gt;where exists()&lt;/STRONG&gt; function on all your files. This will ensure that only records relevant to D1 are loaded and rest are ignored. Flagging them is a bigger problem. Avoiding records is easier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 20:59:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658145#M1076235</guid>
      <dc:creator />
      <dc:date>2014-07-26T20:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658146#M1076237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can be useful. Assuming that you have in memory a load of the previous files:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1- Load your current file:&lt;/P&gt;&lt;P&gt;NMDS:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load*&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[..\..\8.Import\0.NMDS\2013\*.txt]&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2- Left join a flag with those IDs that match your requirement:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Previous_Loaded_Records&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Left Join&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; as [Delete Flag]&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident NMDS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Where Match(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Message&lt;/SPAN&gt;, 'D1') &amp;gt; 0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 22:56:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658146#M1076237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-26T22:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658147#M1076239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I understand your question, but can you post a bit of sample data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 23:13:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658147#M1076239</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-07-26T23:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Re: deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658148#M1076241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see a QVW attached with a basic load inline statement that hopefully illustrates the concept. Note: In reality there are hundreds of tables to load. I don't think a join after the load will work as there will always be a new record with the same PK that gets added once the old one has been deleted or flagged. &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;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 23:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658148#M1076241</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-07-26T23:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658149#M1076244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the delete is always followed by a new insert, could the problem be restated as you want only the last record for each PK? if so, how about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;DataTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *, AutoNumber(RecNo(), PK) as Seq&amp;nbsp; INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PK, Message, Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, A1, 34&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, A1, 54&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, A1, 67&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, A1, 89&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *, AutoNumber(RecNo(), PK) as Seq&amp;nbsp; INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PK, Message, Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, A1, 87&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, A1, 23&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, D1, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, A1, 80&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;INNER JOIN (DataTable)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; PK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Max(Seq) as Seq&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT DataTable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY PK&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will that work or am I being naive about the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 19:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658149#M1076244</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-07-27T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: deleting record from previous table during load</title>
      <link>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658150#M1076245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No you are not being naive and have produced a fantastic solution. I think i was over complicating this!! Your solution&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; works based on the sample provided and I will test on the full data in the next day or two.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The delete may not always be followed by a new insert however if it is not then the delete record would be the one left and these will be excluded anyway. The only thing I need to ensure is they are ordered 'D1' then 'A1' as the records are loaded from each file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks for your help and enjoy the week ahead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Dan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 02:38:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/deleting-record-from-previous-table-during-load/m-p/658150#M1076245</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-07-28T02:38:49Z</dc:date>
    </item>
  </channel>
</rss>

