<?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: Passing a parameter file name to load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298488#M706020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BertyBert, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are really many ways to do it, and you must be aware of exception cases to control, for example if you have to reload data or skip a weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way i suggest is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 - Create the QVW document and define a variable to hold the reference date (Document Properties - Variables - New button) and define the start date. It's very important &lt;STRONG&gt;not to &lt;/STRONG&gt;define the variable directly in script.&lt;/P&gt;&lt;P&gt;In my case i had created a variable called vLastLoad with the date of the last successful load (or the day before the first load)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 - create the load script like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;//vNextLoad stores the next date to load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LET vNextLoad = DayName(vLastLoad,1) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;//vDateLoad is used to format the date according the date mask used in the input filename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LET vDateLoad = date(vNextLoad,'YYYYMMDD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * FROM&lt;/P&gt;&lt;P&gt;Data_&lt;EM&gt;$(vDateLoad)&lt;/EM&gt;.dat&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is '\t', no quotes);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;//here I input an IF to save a new reference day only if the load succeeded&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF ScriptErrorCount = 0 THEN &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vLastLoad = vDateLoad ;&lt;/P&gt;&lt;P&gt;ENDIF &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the different date functions QlikView offers to set the periodicity of the datafile.&lt;/P&gt;&lt;P&gt;If must reset the reference date, you only have to do it in the Document Preferences Window and save the QVW before you restart loading.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2012 14:39:57 GMT</pubDate>
    <dc:creator>bimartingo</dc:creator>
    <dc:date>2012-05-04T14:39:57Z</dc:date>
    <item>
      <title>Passing a parameter file name to load</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298484#M706016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load my information from a file whose name can change over time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my data source is a file automatically by batch and his name is a function of time.&lt;/P&gt;&lt;P&gt;is there a possibility that the script asks me the name of the file to load? and if possible ask me by presenting the name of the old file was loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 08:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298484#M706016</guid>
      <dc:creator />
      <dc:date>2012-01-23T08:55:49Z</dc:date>
    </item>
    <item>
      <title>Passing a parameter file name to load</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298485#M706017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; If you reload using a batch file or the command line, you could always pass the name of the file using the /V switch to set the value of a named variable previously declared in the document, for example:&lt;/P&gt;&lt;P&gt;CALL "C:\PROGRAM FILES\QLIKVIEW\QV.EXE" /R /VVRELOAD=1 "E:\yourpath\yourdocument.QVW"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use 'input' in the script to prompt for a value during script execution - take a look at the help for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 10:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298485#M706017</guid>
      <dc:creator />
      <dc:date>2012-01-23T10:21:18Z</dc:date>
    </item>
    <item>
      <title>Passing a parameter file name to load</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298486#M706018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="long_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I did not understand&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the first approach&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I will&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;summarize very&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;simply.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;The name of my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;source&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;data&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;changes daily&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;wish I could&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;pass&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;as a parameter&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the name of my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;data source.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;Initially&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;: Load&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;* from&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;[Sales&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;20120123&lt;/SPAN&gt;]&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;and the day after&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the file name&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;[Sales&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;20120124&lt;/SPAN&gt;]&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;can I do&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Load&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;* From&lt;/SPAN&gt; &lt;SPAN class="hps atn"&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Variables&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 10:51:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298486#M706018</guid>
      <dc:creator />
      <dc:date>2012-01-23T10:51:48Z</dc:date>
    </item>
    <item>
      <title>Passing a parameter file name to load</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298487#M706019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I take it you mean you need to automate the process completely in that you dont want to supply the name of the file every day?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If its simply a date then can you just calculate the value from the script execution date (using today(0))?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the current file the only one in a folder (gets removed after processing?) in which case you could use the wild card '*' to load the folder contents (the only file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 11:06:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298487#M706019</guid>
      <dc:creator />
      <dc:date>2012-01-23T11:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a parameter file name to load</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298488#M706020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BertyBert, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are really many ways to do it, and you must be aware of exception cases to control, for example if you have to reload data or skip a weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way i suggest is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 - Create the QVW document and define a variable to hold the reference date (Document Properties - Variables - New button) and define the start date. It's very important &lt;STRONG&gt;not to &lt;/STRONG&gt;define the variable directly in script.&lt;/P&gt;&lt;P&gt;In my case i had created a variable called vLastLoad with the date of the last successful load (or the day before the first load)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 - create the load script like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;//vNextLoad stores the next date to load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LET vNextLoad = DayName(vLastLoad,1) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;//vDateLoad is used to format the date according the date mask used in the input filename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LET vDateLoad = date(vNextLoad,'YYYYMMDD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * FROM&lt;/P&gt;&lt;P&gt;Data_&lt;EM&gt;$(vDateLoad)&lt;/EM&gt;.dat&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is '\t', no quotes);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;//here I input an IF to save a new reference day only if the load succeeded&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF ScriptErrorCount = 0 THEN &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vLastLoad = vDateLoad ;&lt;/P&gt;&lt;P&gt;ENDIF &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the different date functions QlikView offers to set the periodicity of the datafile.&lt;/P&gt;&lt;P&gt;If must reset the reference date, you only have to do it in the Document Preferences Window and save the QVW before you restart loading.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 14:39:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298488#M706020</guid>
      <dc:creator>bimartingo</dc:creator>
      <dc:date>2012-05-04T14:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a parameter file name to load</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298489#M706021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest that you actually have the batch file be written to a specific directory,&amp;nbsp;&amp;nbsp; say Input.&amp;nbsp; The script can then read all the files in the directory and then archive the file in to an archive directory.&amp;nbsp; This all can be done via the executing a command line in the script.&amp;nbsp; ie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vArchiveCmd&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'cmd.exe /C copy HistData.qvd HistData_bkup.qvd';&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// &amp;amp;&amp;nbsp; date(today(),'YYYYMMDD') &amp;amp; timestamp(now(), 'hhmmss') &amp;amp; '.xls';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;EXECUTE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vArchiveCmd)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vArchiveCmd&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'cmd.exe /C move HistData.qvd .\Archive';&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// &amp;amp;&amp;nbsp; date(today(),'YYYYMMDD') &amp;amp; timestamp(now(), 'hhmmss') &amp;amp; '.xls';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;EXECUTE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vArchiveCmd)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;You can use wild characters and or get the actual file namess.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 23:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-a-parameter-file-name-to-load/m-p/298489#M706021</guid>
      <dc:creator />
      <dc:date>2013-04-24T23:04:38Z</dc:date>
    </item>
  </channel>
</rss>

