<?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 Dynamic File Name before loading in Script.. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610071#M225155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Hi Experts,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;We have a folder where we get file every day. Each file is having date as below.. some of the filenames are shown below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_09032014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_10032014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;….&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_08042014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_09042014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_10042014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Now our client’s requirement is that file having date 10&lt;SUP&gt;th&lt;/SUP&gt; of every month should be loaded, as the forecast calculation is based on 10&lt;SUP&gt;th&lt;/SUP&gt; of every month to 9&lt;SUP&gt;th&lt;/SUP&gt; of the next month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;So, on March 10&lt;SUP&gt;th&lt;/SUP&gt; the file &lt;STRONG&gt;FileName_10032014 &lt;/STRONG&gt;should be loaded and it will be keep loaded until 10&lt;SUP&gt;th&lt;/SUP&gt; April. Now on April 10&lt;SUP&gt;th&lt;/SUP&gt; &lt;STRONG&gt;FileName_10042014&lt;/STRONG&gt; will be loaded. File having other dates are being used in other apps and should not be loaded at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Let me know how can we achieve this in QlikView Script?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I need the dynamic solution and don’t want to update the filename 10&lt;SUP&gt;th&lt;/SUP&gt; of every month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2014 12:10:03 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2014-04-23T12:10:03Z</dc:date>
    <item>
      <title>Dynamic File Name before loading in Script..</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610071#M225155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Hi Experts,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;We have a folder where we get file every day. Each file is having date as below.. some of the filenames are shown below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_09032014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_10032014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;….&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_08042014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_09042014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;FileName_10042014&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Now our client’s requirement is that file having date 10&lt;SUP&gt;th&lt;/SUP&gt; of every month should be loaded, as the forecast calculation is based on 10&lt;SUP&gt;th&lt;/SUP&gt; of every month to 9&lt;SUP&gt;th&lt;/SUP&gt; of the next month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;So, on March 10&lt;SUP&gt;th&lt;/SUP&gt; the file &lt;STRONG&gt;FileName_10032014 &lt;/STRONG&gt;should be loaded and it will be keep loaded until 10&lt;SUP&gt;th&lt;/SUP&gt; April. Now on April 10&lt;SUP&gt;th&lt;/SUP&gt; &lt;STRONG&gt;FileName_10042014&lt;/STRONG&gt; will be loaded. File having other dates are being used in other apps and should not be loaded at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Let me know how can we achieve this in QlikView Script?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I need the dynamic solution and don’t want to update the filename 10&lt;SUP&gt;th&lt;/SUP&gt; of every month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:10:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610071#M225155</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-23T12:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic File Name before loading in Script..</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610072#M225156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think, you may use for each clause (+ some condiotions on file name inside it):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P class="Code"&gt;&lt;SPAN style="background-color: #316ac5; color: #ffffff;"&gt;FOR&lt;/SPAN&gt; Each File in filelist (Root&amp;amp;' \*.' &amp;amp;Ext)&lt;/P&gt;&lt;P class="Code"&gt;LOAD&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P class="Code"&gt;'$(File)' as Name,&lt;/P&gt;&lt;P class="Code"&gt;FileSize( '$(File)' ) as Size,&lt;/P&gt;&lt;P class="Code"&gt;FileTime( '$(File)' ) as FileTime&lt;/P&gt;&lt;P class="Code"&gt;autogenerate 1;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P class="Code"&gt;&lt;SPAN style="background-color: #316ac5; color: #ffffff;"&gt;NEXT&lt;/SPAN&gt; File&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610072#M225156</guid>
      <dc:creator />
      <dc:date>2014-04-23T12:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic File Name before loading in Script..</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610073#M225157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LET vMonthYear = Date(Today()),'MMYYYY');&lt;/P&gt;&lt;P&gt;LET vDirectory = 'D:\Qlikview\10'&amp;amp;$(vMonthYear)&amp;amp;'.xls';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM $(vDirectory);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:28:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610073#M225157</guid>
      <dc:creator />
      <dc:date>2014-04-23T12:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic File Name before loading in Script..</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610074#M225158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use for loop for the excel file reading or may be you can use * for loading multiple excel file loading&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. With for loop&lt;/P&gt;&lt;P&gt;let vPath = 'C:\test';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each vFile in FileList('$(vPath)\*.xlsx')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TableName:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vFile)' as SourceFile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from [$(vFile)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Using * symbol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:29:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610074#M225158</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-23T12:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic File Name before loading in Script..</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610075#M225159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply...&lt;/P&gt;&lt;P&gt;I sorted out by myself as below... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===================================&lt;/P&gt;&lt;P&gt;Let vDayToday = 10;&lt;/P&gt;&lt;P&gt;Let vMonthToday = NUM(IF(Day(Today())&amp;gt;10,Month(Today()),Month(Today())-1),'00');&lt;/P&gt;&lt;P&gt;Let vYearToday = Year(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Directory;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;FileName_$(vDayToday)$(vMonthToday)$(vYearToday).txt&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=============================================&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 12:40:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-File-Name-before-loading-in-Script/m-p/610075#M225159</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-23T12:40:30Z</dc:date>
    </item>
  </channel>
</rss>

