<?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: Scheduling Incremental Load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652338#M447944</link>
    <description>&lt;P&gt;Replace it with the path and wildcard of your filename:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;E:\Qlikdata\Insight Pack\Targets\Targets *.xls&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will loop all files that have "Targets" in their filename and load the most recent one.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2019 13:35:35 GMT</pubDate>
    <dc:creator>mr_janne</dc:creator>
    <dc:date>2019-11-28T13:35:35Z</dc:date>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652249#M447938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created an Incremental Load QVD but I have a few questions, each month a file will be placed into a folder, is there a way to tell QlikView to look for a new file, rather than hardcoding the file name such as below and changing it each month?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[E:\Qlikdata\Insight Pack\Targets\Targets Dec 19.xls]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, Dec and 19 will change as each month progresses with the latter changing when the year progresses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, is there a way to schedule these so that the Incremental Load is kicked off upon a new file placed in the source folder OR monthly? I think the latter can be done but not sure about the former?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to make this automated and have no user intervention.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 11:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652249#M447938</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-11-28T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652325#M447941</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;Maybe something like this? It will search the most recent file:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;For each vFileName in Filelist ('files_to_search*.qvd')

  Max_File:
  LOAD
  filetime('$(vFileName)') as FileTime,
  '$(vFileName)' as FileName
  autogenerate(1)
  ;

Next

right join(Max_File)
load max(FileTime) as FileTime
resident Max_File;

let vMaxFile = peek ('FileName',0,'Max_File');

drop table Max_File;

Data:
load * from [$(vMaxFile)](QVD);&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Nov 2019 13:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652325#M447941</guid>
      <dc:creator>mr_janne</dc:creator>
      <dc:date>2019-11-28T13:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652327#M447942</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28406"&gt;@mr_janne&lt;/a&gt;&amp;nbsp;thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just so I understand, your code will be kicked off upon a new file being placed into my target folder, regardless of what the filename is?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does the 'Files_to_search*.qvd') mean?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 13:24:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652327#M447942</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-11-28T13:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652338#M447944</link>
      <description>&lt;P&gt;Replace it with the path and wildcard of your filename:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;E:\Qlikdata\Insight Pack\Targets\Targets *.xls&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will loop all files that have "Targets" in their filename and load the most recent one.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 13:35:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652338#M447944</guid>
      <dc:creator>mr_janne</dc:creator>
      <dc:date>2019-11-28T13:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652343#M447945</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28406"&gt;@mr_janne&lt;/a&gt;&amp;nbsp;I have some testing to do. I will get back to you soon.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 13:41:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1652343#M447945</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2019-11-28T13:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1669664#M449354</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28406"&gt;@mr_janne&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picking this up again, sorry for the delay. Am I right in assuming that I don't need a concatenate load or anything like that with your code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 15:16:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1669664#M449354</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-01-27T15:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scheduling Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1669673#M449355</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28406"&gt;@mr_janne&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my existing code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SalesTarget:
//Load Sales Targets data from a previously created Sales Targets QVD.
LOAD Year, 
Month, 
[Item], 
[Rep 1], 
[Rep 2], 
[Rep 3], 
[Rep 4], 
[Rep 5], 
[Rep 6],
SalesTargetPeriod
FROM
[E:\Qlikdata\IP1 Insight Pack 1.4\Data - T\SalesTargets.qvd]
(qvd);

//Find Latest Date in Year/Month so we know where to continue loading new targets from.
Last_YearMonth:
LOAD MAX([Year] &amp;amp; [Month]) as MaxSalesTargetPeriod
Resident SalesTarget;

//Store this date into a variable so that we can work with it.
Let Latest_Target_Date = Peek('MaxSalesTargetPeriod',0,'Latest_Target_Date');

//Drop Table.
Drop Table SalesTarget;

//Load Incremental Data.
Incremental:
LOAD Year, 
Month, 
[Item], 
[Rep 1], 
[Rep 2], 
[Rep 3], 
[Rep 4], 
[Rep 5], 
[Rep 6],
[Year] &amp;amp; [Month] as SalesTargetPeriod
FROM
[E:\Qlikdata\IP1 Insight Pack 1.4\Targets\Targets March 20.xls]
//(biff, embedded labels, table is Sheet1$) WHERE SalesTargetPeriod &amp;gt; $(Latest_Target_Date);
(biff, embedded labels, table is Sheet1$) WHERE [Year] &amp;amp; [Month] &amp;gt; $(Latest_Target_Date);

//Concatenate to the pre-existing QVD.
CONCATENATE
LOAD Year,
Month,
[Item], 
[Rep 1], 
[Rep 2], 
[Rep 3], 
[Rep 4], 
[Rep 5], 
[Rep 6],
SalesTargetPeriod
FROM 
[E:\Qlikdata\IP1 Insight Pack 1.4\Data - TRN\TA.SalesTargets.qvd]
(qvd);

//Replace old QVD.
Store Incremental into E:\Qlikdata\IP1 Insight Pack 1.4\Data - TRN\TA.SalesTargets.qvd(qvd);

//Drop incremental table as we no longer need it.
DROP TABLE Incremental&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bit I want to replace is this here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//Find Latest Date in Year/Month so we know where to continue loading new targets from.
Last_YearMonth:
LOAD MAX([Year] &amp;amp; [Month]) as MaxSalesTargetPeriod
Resident SalesTarget;

//Store this date into a variable so that we can work with it.
Let Latest_Target_Date = Peek('MaxSalesTargetPeriod',0,'Latest_Target_Date');

//Drop Table.
Drop Table SalesTarget;

//Load Incremental Data.
Incremental:
LOAD Year, 
Month, 
[Item], 
[Rep 1], 
[Rep 2], 
[Rep 3, 
[Rep 4], 
[Rep 5], 
[Rep 6],
[Year] &amp;amp; [Month] as SalesTargetPeriod
FROM
[E:\Qlikdata\IP1 Insight Pack 1.4\Targets\Targets March 20.xls]
//(biff, embedded labels, table is Sheet1$) WHERE SalesTargetPeriod &amp;gt; $(Latest_Target_Date);
(biff, embedded labels, table is Sheet1$) WHERE [Year] &amp;amp; [Month] &amp;gt; $(Latest_Target_Date);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So instead of having to go into the QVD and change the month name in the File name, it will see that there is a new file and add the data from the new file, into the existing QVD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want there to be less user intervention here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 15:30:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Scheduling-Incremental-Load/m-p/1669673#M449355</guid>
      <dc:creator>Ahmed_Turnaround</dc:creator>
      <dc:date>2020-01-27T15:30:42Z</dc:date>
    </item>
  </channel>
</rss>

