<?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 How to LOAD data from a variable File Name ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540295#M688609</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 need too determine the data source file from a repository in wich there will be many source file with the same filename pattern. The only part of the name wich change is a block with the date yyyymm &amp;gt; fileNamePrefix_yyyymm_fileNameSuffix.ext&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it could work load the file information with a loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FOR each File IN filelist '../FOLDER/fileNamePrefix_*_fileNameSuffix.ext'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;fileTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD FileName('$(File)') as Filename,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBasename() as FileBasename,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileExtension() as FileExtension,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileDir() as FileDir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //FilePath() as FilePath,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileSize('$(File)') as FileSize,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileTime('$(File)') as FileTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM '$(File)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;next File&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I wanted to determine the most recent file with a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET mySourceFile = MaxString(Filename);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM [../FOLDER/$(mySourceFile)]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wich doesn't work... even if I can get the right value of the variable mySourceFile displayed in a text Box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess there is a way to evaluate the variable that I didn't understand... I tried a lot of option but didn't find the solution.&lt;/P&gt;&lt;P&gt;May someone help me to fix this little issue ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Jerome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Nov 2013 18:06:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-18T18:06:03Z</dc:date>
    <item>
      <title>How to LOAD data from a variable File Name ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540295#M688609</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 need too determine the data source file from a repository in wich there will be many source file with the same filename pattern. The only part of the name wich change is a block with the date yyyymm &amp;gt; fileNamePrefix_yyyymm_fileNameSuffix.ext&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it could work load the file information with a loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FOR each File IN filelist '../FOLDER/fileNamePrefix_*_fileNameSuffix.ext'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;fileTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD FileName('$(File)') as Filename,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBasename() as FileBasename,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileExtension() as FileExtension,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileDir() as FileDir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //FilePath() as FilePath,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileSize('$(File)') as FileSize,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileTime('$(File)') as FileTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM '$(File)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;next File&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I wanted to determine the most recent file with a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET mySourceFile = MaxString(Filename);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM [../FOLDER/$(mySourceFile)]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wich doesn't work... even if I can get the right value of the variable mySourceFile displayed in a text Box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess there is a way to evaluate the variable that I didn't understand... I tried a lot of option but didn't find the solution.&lt;/P&gt;&lt;P&gt;May someone help me to fix this little issue ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Jerome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 18:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540295#M688609</guid>
      <dc:creator />
      <dc:date>2013-11-18T18:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to LOAD data from a variable File Name ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540296#M688610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, you can't just use an aggregation function on a field like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need to use a LOAD statement and (most of the time) a GROUP BY clause.&lt;/P&gt;&lt;P&gt;Or you can sort your table descending and pick the first record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;FOR each File IN filelist '../FOLDER/fileNamePrefix_*_fileNameSuffix.ext'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;fileTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;LOAD FileName('$(File)') as Filename,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBasename() as FileBasename,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileExtension() as FileExtension,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileDir() as FileDir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //FilePath() as FilePath,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileSize('$(File)') as FileSize,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileTime('$(File)') as FileTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM '$(File)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;next File&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;TMP:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;LOAD Filename RESIDENT fileTable ORDER BY Filename desc;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt; mySourceFile = peek('Filename',0,'TMP');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP TABLE TMP;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-family: 'courier new', courier;"&gt;FROM [../FOLDER/$(mySourceFile)]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 18:22:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540296#M688610</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-18T18:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to LOAD data from a variable File Name ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540297#M688611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it works !&lt;/P&gt;&lt;P&gt;thank you for your help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 18:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-LOAD-data-from-a-variable-File-Name/m-p/540297#M688611</guid>
      <dc:creator />
      <dc:date>2013-11-18T18:41:53Z</dc:date>
    </item>
  </channel>
</rss>

