<?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: Incremental load? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954790#M328219</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works great! Brilliant, thank you Jonathan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2015 13:26:16 GMT</pubDate>
    <dc:creator>terezagr</dc:creator>
    <dc:date>2015-08-19T13:26:16Z</dc:date>
    <item>
      <title>Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954783#M328212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to load incrementally data. Problem that I have with this approach is that 2 files can have data for two same dates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E. g. File1 will have data from 22-7-2015 till 29-07-2013(inclusive), File 2 will have data for 29-07-2013 till 05-08-2015. &lt;/P&gt;&lt;P&gt;Sale will be then in both of these files for the date 29-07-2013 = 30. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my following approach I am duplicating the data for 29-07-2015. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to achieve is only to load data once if 2 files have same data for the same date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;QVDFile:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Branch,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sale,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName() as FileName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Path\6_R.csv]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines)&lt;/P&gt;&lt;P&gt;Where Branch&amp;lt;&amp;gt;'Total';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;STORE QVDFile INTO Path\QVDFile.QVD(QVD);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxDate:&lt;/P&gt;&lt;P&gt;LOAD Max([Sale Date]) as MaxDate&lt;/P&gt;&lt;P&gt;Resident QVDFile;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMaxDate = Peek('MaxDate');&lt;/P&gt;&lt;P&gt;DROP Table MaxDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR each File in filelist ('Path\*.csv')&lt;/P&gt;&lt;P&gt;Concatenate (QVDFile) &lt;/P&gt;&lt;P&gt;New:&lt;/P&gt;&lt;P&gt;LOAD [Sale Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Branch, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sale,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(File)' as FileName&lt;/P&gt;&lt;P&gt;From &lt;/P&gt;&lt;P&gt;$(File)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Where Branch&amp;lt;&amp;gt;'Total'&lt;/P&gt;&lt;P&gt;and num([Sale Date]) &amp;gt; $(vMaxDate);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;NEXT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;STORE QVDFile into Path\QVD.QVD(QVD);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 12:50:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954783#M328212</guid>
      <dc:creator>terezagr</dc:creator>
      <dc:date>2015-08-19T12:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954784#M328213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I &lt;EM&gt;think &lt;/EM&gt;you just need to add 'AND WHERE NOT EXISTS([SALE DATE])' at the end of your load statement, so that if the date already exists in your table it isn't loaded again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 12:54:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954784#M328213</guid>
      <dc:creator>richnorris</dc:creator>
      <dc:date>2015-08-19T12:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954785#M328214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was planning to suggest the same - if you have SaleID in your data set, you can use that too. I intend to use something like transaction/sale identifier in the incremental loads.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 13:05:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954785#M328214</guid>
      <dc:creator>kuczynska</dc:creator>
      <dc:date>2015-08-19T13:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954786#M328215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried where not exists(), but it does not do what I would expect to do. If I add where not exists, this will load only unique records from the second load. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However in my files I can have data as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Sale Date]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Branch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sale&lt;/P&gt;&lt;P&gt;29-07-2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;29-07-2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 13:08:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954786#M328215</guid>
      <dc:creator>terezagr</dc:creator>
      <dc:date>2015-08-19T13:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954787#M328216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any form of ID that identifies the sales in these source files? If there is only line per date, than that will do, but I expect that you have multiple lines per date in each file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or can we exclude a date in the second file if it was loaded with the first file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 13:08:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954787#M328216</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-08-19T13:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954788#M328217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right, I have multiple lines per date in each file. I can create a unique ID for sale, although when used with Not Exists, the result is that it gives me only records from the first load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 13:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954788#M328217</guid>
      <dc:creator>terezagr</dc:creator>
      <dc:date>2015-08-19T13:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954789#M328218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can track the loaded dates in a separate field and table to&amp;nbsp; void the Not(exists()) problem. See the added lines in bold:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QVDFile:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Branch,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sale,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName() as FileName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Path\6_R.csv]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines)&lt;/P&gt;&lt;P&gt;Where Branch&amp;lt;&amp;gt;'Total';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LoadedDate:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Distinct [Sale Date] As LoadedDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident QVDFile;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxDate:&lt;/P&gt;&lt;P&gt;LOAD Max([Sale Date]) as MaxDate&lt;/P&gt;&lt;P&gt;Resident QVDFile;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMaxDate = Peek('MaxDate');&lt;/P&gt;&lt;P&gt;DROP Table MaxDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR each File in filelist ('Path\*.csv')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Concatenate (QVDFile)&lt;/P&gt;&lt;P&gt;&amp;nbsp; New:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD [Sale Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp; Branch,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sale,&lt;/P&gt;&lt;P&gt;&amp;nbsp; '$(File)' as FileName&lt;/P&gt;&lt;P&gt;&amp;nbsp; From&lt;/P&gt;&lt;P&gt;&amp;nbsp; $(File)&lt;/P&gt;&lt;P&gt;&amp;nbsp; (txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Where&lt;/P&gt;&lt;P&gt;&amp;nbsp; Branch&amp;lt;&amp;gt;'Total'&lt;/P&gt;&lt;P&gt;&amp;nbsp; and num([Sale Date]) &amp;gt; $(vMaxDate)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; and not(Exists(LoadedDate, [Sale Date]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Concatenate (LoadedDate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LOAD Distinct [Sale Date] As LoadedDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Resident QVDFile;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE QVDFile into Path\QVD.QVD(QVD);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table LoadedDate;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 13:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954789#M328218</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-08-19T13:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load?</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954790#M328219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works great! Brilliant, thank you Jonathan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 13:26:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load/m-p/954790#M328219</guid>
      <dc:creator>terezagr</dc:creator>
      <dc:date>2015-08-19T13:26:16Z</dc:date>
    </item>
  </channel>
</rss>

