<?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 set an expression as a variable in the load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318700#M117455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, I have a QV application with a lot of expressions. Now I want to use variables to store this expressions in, so i can reuse them. You can do this in the variable overview and in the script editor. The first option works fine but in the last one i run in to a problem. For Example, I have the next formula;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={$(=[PIT period])},[Fiscal year]={$(=[PIT year])}&amp;gt;}(Data)))/100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I put this one in the script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vExpr4Actual =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={$(=[PIT period])},[Fiscal year]={$(=[PIT year])}&amp;gt;}(Data)))/100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run it, the formule doesn't work anymore and looks like this in the variable overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={(internal error)},[Fiscal year]={(internal error)}&amp;gt;}(Data)))/100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the script engine wants to interpret the variables, can anyone help me out here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 May 2011 08:25:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-23T08:25:06Z</dc:date>
    <item>
      <title>set an expression as a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318700#M117455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, I have a QV application with a lot of expressions. Now I want to use variables to store this expressions in, so i can reuse them. You can do this in the variable overview and in the script editor. The first option works fine but in the last one i run in to a problem. For Example, I have the next formula;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={$(=[PIT period])},[Fiscal year]={$(=[PIT year])}&amp;gt;}(Data)))/100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I put this one in the script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vExpr4Actual =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={$(=[PIT period])},[Fiscal year]={$(=[PIT year])}&amp;gt;}(Data)))/100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run it, the formule doesn't work anymore and looks like this in the variable overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={(internal error)},[Fiscal year]={(internal error)}&amp;gt;}(Data)))/100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the script engine wants to interpret the variables, can anyone help me out here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 08:25:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318700#M117455</guid>
      <dc:creator />
      <dc:date>2011-05-23T08:25:06Z</dc:date>
    </item>
    <item>
      <title>set an expression as a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318701#M117456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;one workaorund which I found on this site and worked for me was to replace the "$" with it's ASCII equivalent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vExpr4Actual='(Avg ({&amp;lt;Fact= {'X'},[Fiscal period]={' &amp;amp; chr(36) &amp;amp; '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;(=[PIT period])},[Fiscal year]={' &amp;amp; chr(36) &amp;amp; '(=[PIT year])}&amp;gt;}(Data)))/100';&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Rob Wunderlich has a post on his blog putting the question of escape characters high on his wishlist for new things from qlikview to avoid this kind of messy construction]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 08:35:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318701#M117456</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-05-23T08:35:44Z</dc:date>
    </item>
    <item>
      <title>set an expression as a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318702#M117457</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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use "Let" keyword instead of "Set".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I hope this will solve your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 08:36:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318702#M117457</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-05-23T08:36:41Z</dc:date>
    </item>
    <item>
      <title>set an expression as a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318703#M117458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let wil try to evaluate the expresion, so that isn't a solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 08:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318703#M117458</guid>
      <dc:creator />
      <dc:date>2011-05-23T08:38:16Z</dc:date>
    </item>
    <item>
      <title>set an expression as a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318704#M117459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This answer seems to solve the problem, only i have to rewrite all the formula's.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 08:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-an-expression-as-a-variable-in-the-load-script/m-p/318704#M117459</guid>
      <dc:creator />
      <dc:date>2011-05-23T08:39:55Z</dc:date>
    </item>
  </channel>
</rss>

