<?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: Help - Front-end variables in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100030#M365074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that's because the dollar sign expansion is getting evaluated in the script, which is not what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several methods to avoid this (one could be to load all variables from an excel file, I think there is a sample script in the reference manual that demonstrates this, you can also find the code here in the forum.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach would be using replace() function to replace an arbitrary dummy character not used in your original string with the dollar sign:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Let MAT_VAR = Replace('&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(sum({&amp;lt;CurMATFlag={1}&amp;gt;}&amp;nbsp; ^(VarFact))-sum({&amp;lt;LastMATFlag={1}&amp;gt;}&amp;nbsp;&amp;nbsp; ^(VarFact)))/1000*^(VarFactor)'),'^','@');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 May 2016 22:19:11 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-05-31T22:19:11Z</dc:date>
    <item>
      <title>Help - Front-end variables in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100029#M365073</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'm using variables in my report/graphs in order to enhance flexibiity.&lt;/P&gt;&lt;P&gt;(sum({&amp;lt;CurMATFlag={1}&amp;gt;}&amp;nbsp; $(VarFact))-sum({&amp;lt;LastMATFlag={1}&amp;gt;}&amp;nbsp; $(VarFact)))/1000*$(VarFactor)&lt;/P&gt;&lt;P&gt;VarFact is a variable for different facts like Volume, Margin etc&lt;/P&gt;&lt;P&gt;VarFactor is a variable for the scale&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to move this expression into the script and use a variable in my graphs&lt;/P&gt;&lt;P&gt;Let MAT_VAR = '&lt;SPAN style="font-size: 13.3333px;"&gt;(sum({&amp;lt;CurMATFlag={1}&amp;gt;}&amp;nbsp; $(VarFact))-sum({&amp;lt;LastMATFlag={1}&amp;gt;}&amp;nbsp; $(VarFact)))/1000*$(VarFactor)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now VarFact and VarFactor are static and don't get calculated. I tried several things based on posts of&amp;nbsp; HIC&amp;nbsp; &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables"&gt;https://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but I can't find the right syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks! Joris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 19:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100029#M365073</guid>
      <dc:creator>joris_lansdaal</dc:creator>
      <dc:date>2016-05-31T19:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help - Front-end variables in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100030#M365074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that's because the dollar sign expansion is getting evaluated in the script, which is not what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several methods to avoid this (one could be to load all variables from an excel file, I think there is a sample script in the reference manual that demonstrates this, you can also find the code here in the forum.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach would be using replace() function to replace an arbitrary dummy character not used in your original string with the dollar sign:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Let MAT_VAR = Replace('&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(sum({&amp;lt;CurMATFlag={1}&amp;gt;}&amp;nbsp; ^(VarFact))-sum({&amp;lt;LastMATFlag={1}&amp;gt;}&amp;nbsp;&amp;nbsp; ^(VarFact)))/1000*^(VarFactor)'),'^','@');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 22:19:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100030#M365074</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-05-31T22:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help - Front-end variables in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100031#M365075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IMHO the simplest solution for unwanted script-level dollar sign exapnsion is the mighty concatenation operator '&amp;amp;'. Like in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;Let MAT_VAR = '&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier; color: #3d3d3d;"&gt;(sum({&amp;lt;CurMATFlag={1}&amp;gt;} $' &amp;amp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '(VarFact))-sum({&amp;lt;LastMATFlag={1}&amp;gt;} $' &amp;amp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '(VarFact)))/1000*$' &amp;amp; '(VarFactor)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Separating the $-sign from the parenthesis is enough to trick the expansion preprocessor. I admit that this doesn't really improve expression readability...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Peter&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 22:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100031#M365075</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-05-31T22:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help - Front-end variables in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100032#M365076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Stefan mentioned, one way is to load the variables from Excel into Qlikview. If you are interested in this concept you can take a look at the attached file which loads the variables from Excel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 22:40:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-Front-end-variables-in-the-script/m-p/1100032#M365076</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2016-05-31T22:40:47Z</dc:date>
    </item>
  </channel>
</rss>

