<?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 Variable in Store function not working properly in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-in-Store-function-not-working-properly/m-p/1750614#M720115</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Been trying to figure this out without success on my own.&lt;/P&gt;&lt;P&gt;I want to export a table with a custom name, that is dependent on a variable.&lt;/P&gt;&lt;P&gt;This is what works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let testMonth = '123';
Store EfektivitateExport into 'W:\SecretLocation\$(testMonth).csv' (txt);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run this code here, it exports a file named "123.csv" in the desied location.&lt;/P&gt;&lt;P&gt;However, if I define the variable as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let testMonth = maxmonth;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where &lt;EM&gt;maxmonth&lt;/EM&gt; is a variable that has a value of "8" , the exported file has blank name.&lt;/P&gt;&lt;P&gt;I would like to know what can I do to make a dynamic export file name that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;When I make a table with field maxmonth, it gives one result "8", so I assume that there is no problem.&lt;BR /&gt;When I make a variable in script &lt;EM&gt;let testMonth = maxmonth;&lt;/EM&gt; the testMonth variable has no value after the reload? Why is that?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 18:00:06 GMT</pubDate>
    <dc:creator>FakeJupiter</dc:creator>
    <dc:date>2024-11-16T18:00:06Z</dc:date>
    <item>
      <title>Variable in Store function not working properly</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Store-function-not-working-properly/m-p/1750614#M720115</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Been trying to figure this out without success on my own.&lt;/P&gt;&lt;P&gt;I want to export a table with a custom name, that is dependent on a variable.&lt;/P&gt;&lt;P&gt;This is what works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let testMonth = '123';
Store EfektivitateExport into 'W:\SecretLocation\$(testMonth).csv' (txt);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run this code here, it exports a file named "123.csv" in the desied location.&lt;/P&gt;&lt;P&gt;However, if I define the variable as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let testMonth = maxmonth;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where &lt;EM&gt;maxmonth&lt;/EM&gt; is a variable that has a value of "8" , the exported file has blank name.&lt;/P&gt;&lt;P&gt;I would like to know what can I do to make a dynamic export file name that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;When I make a table with field maxmonth, it gives one result "8", so I assume that there is no problem.&lt;BR /&gt;When I make a variable in script &lt;EM&gt;let testMonth = maxmonth;&lt;/EM&gt; the testMonth variable has no value after the reload? Why is that?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Store-function-not-working-properly/m-p/1750614#M720115</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2024-11-16T18:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in Store function not working properly</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Store-function-not-working-properly/m-p/1750725#M720116</link>
      <description>&lt;P&gt;If maxmonth is really a (valid) variable you don't need to create an extra variable testMonth to use it within the store-statement else you could use maxmonth.&lt;/P&gt;&lt;P&gt;But I assume you don't mean a variable else a fieldvalue. To grab any fieldvalue within the script you need a load or functions like peek() or fieldvalue() which may look in your case like:&lt;/P&gt;&lt;P&gt;let testMonth = fieldvalue('maxmonth', 1);&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:48:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Store-function-not-working-properly/m-p/1750725#M720116</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-10-08T13:48:04Z</dc:date>
    </item>
  </channel>
</rss>

