<?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: How to filter a .csv by the name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668581#M669005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want this code to cross year ends, change the 02 parameter in Tresesco's first LOAD into a 06. In that way, the script'll grab CMT_201501.csv instead of CMT_201412.csv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2014 11:03:50 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2014-10-21T11:03:50Z</dc:date>
    <item>
      <title>How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668579#M669003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I have a .qvw application with a couple of .csv as datasource, the file are named like&amp;nbsp; CMT_201406.csv&amp;nbsp; , CMT_201407.csv and there is an FTP that places the new file ( eg. CMT_201408.csv ) every month in the same folder. I want that the application catch the last file and not the other ones. ( every file contains not only the data of the month, but the entire dataset from january till the current month ). &lt;/P&gt;&lt;P&gt;In the script i have inserted the following line: right (FileBaseName(),02) as last2digit, in this way i have the last 2 digit of the file name, how can i set the load in order to catch the file in the folder with the last two digits higher?&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 09:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668579#M669003</guid>
      <dc:creator />
      <dc:date>2014-10-21T09:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668580#M669004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you just overwrite the file? Anyway, the way you want could be achieved by something like:&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(right (FileBaseName(),6)) as MaxFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Corrected&lt;/P&gt;&lt;P&gt;From &amp;lt; .../*.csv&amp;gt;;&lt;/P&gt;&lt;P&gt;Let vMax= Peek('MaxFile');&lt;/P&gt;&lt;P&gt;Let vFileName='CMT_'&amp;amp;$(vMax)&amp;amp;'.csv';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Corrected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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; *&lt;/P&gt;&lt;P&gt;From &amp;lt;..../&amp;amp;'$(vFileName)' &amp;gt;; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 10:09:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668580#M669004</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-10-21T10:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668581#M669005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want this code to cross year ends, change the 02 parameter in Tresesco's first LOAD into a 06. In that way, the script'll grab CMT_201501.csv instead of CMT_201412.csv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 11:03:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668581#M669005</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-21T11:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668582#M669006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good catch. For mutiple year data maintenance, all six digits have to be considered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 11:10:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668582#M669006</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-10-21T11:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668583#M669007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set vFileName='CMT_'&amp;amp;$(vMax)&amp;amp;'.csv';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt; vFileName='CMT_'&amp;amp;$(vMax)&amp;amp;'.csv';&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;Tjeerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 11:52:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668583#M669007</guid>
      <dc:creator>tabletuner</dc:creator>
      <dc:date>2014-10-21T11:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668584#M669008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SET vFileName = 'CMT_$(vMax).csv';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will also work. String substitution will always be applied, whatever the statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 12:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668584#M669008</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-21T12:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668585#M669009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried with this script:&lt;/P&gt;&lt;P&gt;Temp: &lt;/P&gt;&lt;P&gt; Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(right (FileBaseName(),2)) as MaxFile&lt;/P&gt;&lt;P&gt;From *.csv;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMax= Peek('MaxFile');&lt;/P&gt;&lt;P&gt;set vFileName=CMT_'&amp;amp;'$(vMax)'.csv ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; *&lt;/P&gt;&lt;P&gt;FROM &amp;lt;$(vFileName)&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it did not caught anything from the file.&lt;/P&gt;&lt;P&gt;i've added a text box to show the value of the variable vFileName and this was the result: &lt;IMG alt="vFileName.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/69434_vFileName.PNG.png" /&gt;&lt;/P&gt;&lt;P&gt;I cannot understand where the error could be, surely is in the definition of the variable vFileName.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 22:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668585#M669009</guid>
      <dc:creator />
      <dc:date>2014-10-21T22:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668586#M669010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this script. It's an assembly of various comments from above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD Max(Right(FileBaseName(), 6)) AS MaxFile&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM '*.csv' (txt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LET vMax = Peek('MaxFile');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP Table Temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Data:&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;FROM 'CMT_$(vMax).csv' (txt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to know the value of vMax, just open Settings-&amp;gt;Variable Overview... at the end of the script run, and scroll down until you encounter vMax in the variable list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 22:24:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668586#M669010</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-21T22:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to filter a .csv by the name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668587#M669011</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;thanks everybody for the help.&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 12:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-filter-a-csv-by-the-name/m-p/668587#M669011</guid>
      <dc:creator />
      <dc:date>2014-10-22T12:25:29Z</dc:date>
    </item>
  </channel>
</rss>

