<?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 Create variable filename, and load from variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803886#M665890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to create a variable in the load script, and use it as PART of the file name to load from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is my vNewestFolder working in the qvw itself, but not passing the value into the file name? I'm just trying to slip that variable in as part of my filepath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vNewestFolder = max(MaxFolder);&lt;/P&gt;&lt;P&gt;set vFileName = 'D:\Apps2\CUSTOMER RELATIONS\VendorOrderStatus_Emails\' &amp;amp; $(vNewestFolder) &amp;amp; '*';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataLoad:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(vFileName)]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is &lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 17:12:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-16T17:12:10Z</dc:date>
    <item>
      <title>Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803886#M665890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to create a variable in the load script, and use it as PART of the file name to load from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is my vNewestFolder working in the qvw itself, but not passing the value into the file name? I'm just trying to slip that variable in as part of my filepath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vNewestFolder = max(MaxFolder);&lt;/P&gt;&lt;P&gt;set vFileName = 'D:\Apps2\CUSTOMER RELATIONS\VendorOrderStatus_Emails\' &amp;amp; $(vNewestFolder) &amp;amp; '*';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataLoad:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(vFileName)]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is &lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 17:12:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803886#M665890</guid>
      <dc:creator />
      <dc:date>2015-01-16T17:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803887#M665891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could add a trace on the variables to see what values they are being set with.&lt;/P&gt;&lt;P&gt;Is there a "v" missing from MaxFolder, should it be vMaxFolder?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;set vNewestFolder = max(MaxFolder);&lt;/P&gt;&lt;P&gt;trace vNewestFolder = $(vNewestFolder) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vFileName = 'D:\Apps2\CUSTOMER RELATIONS\VendorOrderStatus_Emails\' &amp;amp; $(vNewestFolder) &amp;amp; '*';&lt;/P&gt;&lt;P&gt;trace vFileName = $(vFileName ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataLoad:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(vFileName)]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is &lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 17:23:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803887#M665891</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-01-16T17:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803888#M665892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MaxFolder is a field i calculated in a prior table &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 17:27:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803888#M665892</guid>
      <dc:creator />
      <dc:date>2015-01-16T17:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803889#M665893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;set vNewestFolder = max(MaxFolder); will set the variable vNewestFolder to the string value 'max(MaxFolder)'. That's probably not what you want. If you have a table with a field MaxFolder you can retrieve the max value of that like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD max(MaxFolder) as MaxMaxFolder&lt;/P&gt;&lt;P&gt;RESIDENT ...table_containing_maxfolder...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vNewestFolder = peek('MaxMaxFolder');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 17:28:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803889#M665893</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-01-16T17:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803890#M665894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked on letting me use the right vNewestFolder!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, how do i integrate that in my filepath?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&lt;/P&gt;&lt;P&gt;&lt;D&gt;&lt;/D&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this isn't working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 18:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803890#M665894</guid>
      <dc:creator />
      <dc:date>2015-01-16T18:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803891#M665895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works for me. But &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt;table is &lt;/EM&gt;&lt;LI&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/SPAN&gt; will not work. If you want to load all the sheets from an excel file you'll have to use a different approach using odbc and the sqltables function. See this discussion for an example: &lt;A _jive_internal="true" href="https://community.qlik.com/message/546602#546602" title="http://community.qlik.com/message/546602#546602"&gt;http://community.qlik.com/message/546602#546602&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 18:46:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803891#M665895</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-01-16T18:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803892#M665896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Script to remove all preceding and post fluff from the folder name - resulting in a YYYYMMDD value&lt;/P&gt;&lt;P&gt;//Preceding load grabs the most recent value&lt;/P&gt;&lt;P&gt;MaxFolder:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;max(SourceFile) as MaxFolder;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Mid(SourceFile, index(SourceFile,'Emails')+7,index(SourceFile,'\2')-index(SourceFile,'Emails')+2) as SourceFile&lt;/P&gt;&lt;P&gt;Resident FileList;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Peek the most recent value, MaxFolder&lt;/P&gt;&lt;P&gt;Let vNewestFolder = peek('MaxFolder');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Load all *.xlsx files from the folder that matches the vMaxFolder = YYYYMMDD that is most recent&lt;/P&gt;&lt;P&gt;DataLoad:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;D&gt;&lt;/D&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 18:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803892#M665896</guid>
      <dc:creator />
      <dc:date>2015-01-16T18:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803893#M665897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up removing the tab code, as I always want to load the first one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 18:50:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803893#M665897</guid>
      <dc:creator />
      <dc:date>2015-01-16T18:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create variable filename, and load from variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803894#M665898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just as a note the variable that you "Let" for the file path can NOT include the [square brackets] in the syntex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2018 14:17:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-variable-filename-and-load-from-variable/m-p/803894#M665898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-17T14:17:27Z</dc:date>
    </item>
  </channel>
</rss>

