<?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: Weekly incremental load by pulling in 12 weeks and replacing in QVD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777161#M663218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If an optimized QVD load is important (I'm guessing is is based on the sizes), I would load the QVD first and then Concatenate the SQL results. Use a where not exists() to maintain the optimized load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ExcludeDates:&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; date(today() - RecNo())+1 as &lt;SPAN style="color: #3d3d3d;"&gt;Report_Date&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AutoGenerate 7*20&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;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;Sales_Fact_Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * FROM &lt;SPAN style="color: #3d3d3d;"&gt;..\Sales_Facts.qvd(qvd)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;WHERE NOT exists(&lt;SPAN style="color: #3d3d3d;"&gt;Report_Date)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Load the SQL and concat to already loaded table&lt;/SPAN&gt;&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" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jan 2015 00:26:02 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2015-01-13T00:26:02Z</dc:date>
    <item>
      <title>Weekly incremental load by pulling in 12 weeks and replacing in QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777159#M663216</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 been struggling with syntax here. I have a requirement for a 12 week requirement. Huge amounts of data, nearly a billion rows from each of the fact tables involved. We do not have unique keys as that would take too much memory (about 4-7 times in several tests, using hash128 and just contcatenating dimensions to make unique keys).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, the requirements are fairly simple: extract the last 20 weeks of data from the data source. In the stored QVD of full history data, bring in all history except for the last 20 weeks, and concatenate that with the 20 weeks loaded.&lt;/P&gt;&lt;P&gt;-----------------------&lt;/P&gt;&lt;P&gt;Question: would you pull in the last 20 weeks in the load statement, and pull in everything older than 20 weeks in the QVD in the concatenation load?&lt;/P&gt;&lt;P&gt;------------------------&lt;/P&gt;&lt;P&gt;Sample code I'm applying this to:&lt;/P&gt;&lt;P&gt;------------------------&lt;/P&gt;&lt;P&gt;Sales_Fact_Table:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Sales_Type,&lt;BR /&gt;Salesperson_ID,&lt;BR /&gt;Report_Date,&lt;BR /&gt;Customer_Age,&lt;BR /&gt;Product_ID,&lt;BR /&gt;Number_Sold,&lt;BR /&gt;Number_Forecast;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;Sales.Sales_Type as Sales_Type,&lt;BR /&gt;Sales.Salesperson_ID as Salesperson_ID,&lt;BR /&gt;Sales.Report_Date as Report_Date,&lt;BR /&gt;Sales.Customer_Age as Customer_Age,&lt;BR /&gt;Sales.Product_ID as Product_ID,&lt;BR /&gt;Sales.Number_Sold as Number_Sold,&lt;BR /&gt;Sales.Number_Forecast as Number_Forecast&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Data.Sales as Sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;Report_Date &amp;gt;= '1/1/2015'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY&lt;/P&gt;&lt;P&gt;Sales.Sales_Type as Sales_Type,&lt;BR /&gt;Sales.Salesperson_ID as Salesperson_ID,&lt;BR /&gt;Sales.Report_Date as Report_Date,&lt;BR /&gt;Sales.Customer_Age as Customer_Age,&lt;BR /&gt;Sales.Product_ID as Product_ID,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Concatenate (Sales_Fact_Table)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Sales_Type,&lt;BR /&gt;Salesperson_ID,&lt;BR /&gt;Report_Date,&lt;BR /&gt;Customer_Age,&lt;BR /&gt;Product_ID,&lt;BR /&gt;Number_Sold,&lt;BR /&gt;Number_Forecast;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;FROM&lt;/P&gt;&lt;P&gt;..\Sales_Facts.qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;STORE&lt;/P&gt;&lt;P&gt;Sales_Fact_Table into&lt;/P&gt;&lt;P&gt;..\Sales_Facts.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 22:19:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777159#M663216</guid>
      <dc:creator />
      <dc:date>2015-01-12T22:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly incremental load by pulling in 12 weeks and replacing in QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777160#M663217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Here is a sample on doing incremental load - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vExists = If(Filesize('Yourfile.qvd')&amp;gt;0,-1,0)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;Let VNo_Of_Days_To_Load = 140 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If $(vExists ) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max_Day:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; DAY_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp; From Yourfile.qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RENAME Table Max_Day to Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max_Day:&lt;/P&gt;&lt;P&gt;&amp;nbsp; NoConcatenate&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load Max(DAY_CODE) as Max_Day&lt;/P&gt;&lt;P&gt;&amp;nbsp; Resident Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let VMin_Date_To_Load = Date(Peek('Max_Day'));&lt;/P&gt;&lt;P&gt;Set vFilter = DAY_CODE &amp;gt;= '$(VMin_Date_To_Load )' ;&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;LET VMin_Date_To_Load =&amp;nbsp; Date(Today()- $(VNo_Of_Days_To_Load),'MM/DD/YYYY');&lt;/P&gt;&lt;P&gt;Set vFilter = DAY_CODE &amp;gt;= '$(VMin_Date_To_Load )' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndIf&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load * From DB&lt;/P&gt;&lt;P&gt;Where vFilter ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If $(vExists ) then&lt;/P&gt;&lt;P&gt;Concatenate(Table)&lt;/P&gt;&lt;P&gt;Load * From Yourfile.qvd(qvd) &lt;/P&gt;&lt;P&gt;Where DAY_CODE &amp;gt;= Date(Today()- $(VNo_Of_Days_To_Load),'MM/DD/YYYY') and&lt;/P&gt;&lt;P&gt;DAY_CODE &amp;lt; '$(VMin_Date_To_Load )' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndIf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Table into Yourfile.qvd(qvd)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;Drop Table Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just for an idea. You have to tweak it for your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 22:55:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777160#M663217</guid>
      <dc:creator />
      <dc:date>2015-01-12T22:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly incremental load by pulling in 12 weeks and replacing in QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777161#M663218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If an optimized QVD load is important (I'm guessing is is based on the sizes), I would load the QVD first and then Concatenate the SQL results. Use a where not exists() to maintain the optimized load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ExcludeDates:&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; date(today() - RecNo())+1 as &lt;SPAN style="color: #3d3d3d;"&gt;Report_Date&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AutoGenerate 7*20&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;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;Sales_Fact_Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * FROM &lt;SPAN style="color: #3d3d3d;"&gt;..\Sales_Facts.qvd(qvd)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;WHERE NOT exists(&lt;SPAN style="color: #3d3d3d;"&gt;Report_Date)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Load the SQL and concat to already loaded table&lt;/SPAN&gt;&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" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 00:26:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekly-incremental-load-by-pulling-in-12-weeks-and-replacing-in/m-p/777161#M663218</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-13T00:26:02Z</dc:date>
    </item>
  </channel>
</rss>

