<?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 Another Incremental Question - Append Only in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217934#M71107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ruan,&lt;/P&gt;&lt;P&gt;The easiest way is to use the peek() function but that will only work if your QVD is stored with a sortorder by recordno or you do a GROUP BY. Then you can create the following variable after your first table load: LET vMaxRecord = peek('cs.recordno',-1,CARTONSCANNING); You can then use this variable in your SQL load by check &amp;lt; $(vMaxRecord). If your QVD is not stored in a sorted way, you will need to load it from QVD. Then create a temporary table as follows:&lt;/P&gt;&lt;P&gt;temp_table:&lt;BR /&gt;NOCONCATENATE LOAD * RESIDENT CARTONSCANNING&lt;BR /&gt;ORDER BY cs.recordno;&lt;/P&gt;&lt;P&gt;The peek variable would then reference the temp_table. As soon as you set the variable you can drop the temp_table.&lt;/P&gt;&lt;P&gt;Another alternative, if you don't want to sort it, is to do a GROUP BY. Add the following field to your first table load: 1 as temp_counter. Then create your GROUP BY table:&lt;/P&gt;&lt;P&gt;temp_table:&lt;BR /&gt;LOAD&lt;BR /&gt; temp_counter,&lt;BR /&gt; max(cs.recordno) as maxrecord&lt;BR /&gt;RESIDENT CARTONSCANNING&lt;BR /&gt;GROUP BY temp_counter;&lt;/P&gt;&lt;P&gt;LET vMaxRecord = peek('maxrecord',1,temp_table);&lt;/P&gt;&lt;P&gt;Either way, you can then use the vMaxRecord variable in your second load. By the way, your second load should be a CONCATENATE instead of an outer join (it's faster).&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Apr 2011 23:38:24 GMT</pubDate>
    <dc:creator>vgutkovsky</dc:creator>
    <dc:date>2011-04-15T23:38:24Z</dc:date>
    <item>
      <title>Another Incremental Question - Append Only</title>
      <link>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217933#M71106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Im trying to solve a incremental load problem i just cant solve, i use a QVD file that stores a certain mysql table. now i want to collect the new entries in the mysql table and append it to my QVD but i cant figure how to make it look at the QVD max (recordno) and only add mysql data after that record. at the moment i tested a manual figure of 530000 and it working. any help greatly appreciated.&lt;/P&gt;&lt;P&gt;I have the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;"CARTONSCANNING":&lt;BR /&gt;LOAD&lt;BR /&gt;cs.recordno,&lt;BR /&gt;date(cs.scandate),&lt;BR /&gt;time(cs.scantime),&lt;BR /&gt;cs.line,&lt;BR /&gt;cs.va,&lt;BR /&gt;cs.pk,&lt;BR /&gt;cs.sz,&lt;BR /&gt;cs.gr,&lt;BR /&gt;cs.nc,&lt;BR /&gt;cs.fc,&lt;BR /&gt;cs.pu,&lt;BR /&gt;cs.pn,&lt;BR /&gt;cs.tk,&lt;BR /&gt;cs.co,&lt;BR /&gt;cs.oz&lt;BR /&gt;FROM $(StorageFolder)CARTONSCANNING.QVD (QVD)&lt;BR /&gt;WHERE cs.recordno &amp;lt;= '530000';&lt;BR /&gt;&lt;BR /&gt;JOIN LOAD&lt;BR /&gt;recordno as cs.recordno,&lt;BR /&gt;date(scandate) as cs.scandate,&lt;BR /&gt;date(today()) as cs.today,&lt;BR /&gt;scantime as cs.scantime,&lt;BR /&gt;line as cs.line,&lt;BR /&gt;va as cs.va,&lt;BR /&gt;pk as cs.pk,&lt;BR /&gt;sz as cs.sz,&lt;BR /&gt;gr as cs.gr,&lt;BR /&gt;nc as cs.nc,&lt;BR /&gt;fc as cs.fc,&lt;BR /&gt;pu as cs.pu,&lt;BR /&gt;pn as cs.pn,&lt;BR /&gt;tk as cs.tk,&lt;BR /&gt;co as cs.co,&lt;BR /&gt;oz as cs.oz;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM vitrax_2011.bcinputs&lt;BR /&gt;WHERE recordno &amp;gt; '530000';&lt;BR /&gt;&lt;BR /&gt;STORE "CARTONSCANNING" INTO $(StorageFolder)CARTONSCANNINGTEMP.QVD (QVD);&lt;BR /&gt;DROP TABLE "CARTONSCANNING";&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 12:04:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217933#M71106</guid>
      <dc:creator />
      <dc:date>2011-04-15T12:04:16Z</dc:date>
    </item>
    <item>
      <title>Another Incremental Question - Append Only</title>
      <link>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217934#M71107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ruan,&lt;/P&gt;&lt;P&gt;The easiest way is to use the peek() function but that will only work if your QVD is stored with a sortorder by recordno or you do a GROUP BY. Then you can create the following variable after your first table load: LET vMaxRecord = peek('cs.recordno',-1,CARTONSCANNING); You can then use this variable in your SQL load by check &amp;lt; $(vMaxRecord). If your QVD is not stored in a sorted way, you will need to load it from QVD. Then create a temporary table as follows:&lt;/P&gt;&lt;P&gt;temp_table:&lt;BR /&gt;NOCONCATENATE LOAD * RESIDENT CARTONSCANNING&lt;BR /&gt;ORDER BY cs.recordno;&lt;/P&gt;&lt;P&gt;The peek variable would then reference the temp_table. As soon as you set the variable you can drop the temp_table.&lt;/P&gt;&lt;P&gt;Another alternative, if you don't want to sort it, is to do a GROUP BY. Add the following field to your first table load: 1 as temp_counter. Then create your GROUP BY table:&lt;/P&gt;&lt;P&gt;temp_table:&lt;BR /&gt;LOAD&lt;BR /&gt; temp_counter,&lt;BR /&gt; max(cs.recordno) as maxrecord&lt;BR /&gt;RESIDENT CARTONSCANNING&lt;BR /&gt;GROUP BY temp_counter;&lt;/P&gt;&lt;P&gt;LET vMaxRecord = peek('maxrecord',1,temp_table);&lt;/P&gt;&lt;P&gt;Either way, you can then use the vMaxRecord variable in your second load. By the way, your second load should be a CONCATENATE instead of an outer join (it's faster).&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 23:38:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217934#M71107</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-04-15T23:38:24Z</dc:date>
    </item>
    <item>
      <title>Another Incremental Question - Append Only</title>
      <link>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217935#M71108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx in advance, i will try this sometime during the week and give feedback,.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 09:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Another-Incremental-Question-Append-Only/m-p/217935#M71108</guid>
      <dc:creator />
      <dc:date>2011-04-18T09:03:05Z</dc:date>
    </item>
  </channel>
</rss>

