<?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: Variable inside a variable in the load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219119#M622288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're in need of something you could call "Delayed expansion". Meaning that the embedded $-sign construct should be expanded when the expression is evaluated (in a UI object), &lt;EM&gt;not&lt;/EM&gt; when the text is assigned to the expression variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of techniques for avoiding this effect. Sunny has already shown a few. Here are some others:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;An assignment using a LET statement has expansion of embedded $-sign constructs blocked, as soon as even a single space is put between the $-sign and the opening bracket. Usually this means you've got to glue together pieces of a string, like:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vExpression = '=count({&amp;lt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;$' &amp;amp; '(&lt;/STRONG&gt;&lt;/SPAN&gt;vSetSpec)&amp;gt;} LineFlag)';&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;If you use variables (i.e. not strings) to pass around your expressions, no substitution will be performed as the Script engine will only perform substitution on script content, never on variable content&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Feb 2017 14:05:51 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2017-02-06T14:05:51Z</dc:date>
    <item>
      <title>Variable inside a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219115#M622282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable which works fine when added manually to Settings &amp;gt; Variable Overview but does not work when loaded in from a text file via the load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the expression:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(GetFieldSelections(Metric_List)) or wildmatch(GetFieldSelections(Metric_List),'Customer Count'),&lt;/P&gt;&lt;P&gt;num(sum({&amp;lt;CA={'1'} &amp;gt;} CUS),'###########,###'),&lt;/P&gt;&lt;P&gt;num((sum({&amp;lt;CA={'1'} &amp;gt;} $(vMetric_Percent))/sum({&amp;lt;CA={'1'} &amp;gt;} CUS)),'#,##0.##%'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable reference is vMetric_Percent which has this value inside it =MetricLookup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to load this expression from a text file unchanged instead of &lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(vMetric_Percent) it has been evaluated as =MetricLookup and therefore does not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to get around this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Stuart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 13:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219115#M622282</guid>
      <dc:creator />
      <dc:date>2017-02-06T13:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219116#M622283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be check this out:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/162827"&gt;Re: Stop Dollar Sign Expansion in the script (Escape Character ??? )&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 13:44:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219116#M622283</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-06T13:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219117#M622284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another one:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlikview.com/message/72861#72861" title="https://community.qlikview.com/message/72861#72861"&gt;Avoid Dollar sign expansion when reloading | Qlik Community&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 13:45:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219117#M622284</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-06T13:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219118#M622286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you check this in Text object and see whether the value is coming up over there?&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;&lt;STRONG&gt;=$(vMetric_Percent)&lt;/STRONG&gt;&lt;/SPAN&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;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&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;And then, What you have written for Variable and where do you written(I mean Variable overview / Script)&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 13:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219118#M622286</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-02-06T13:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside a variable in the load script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219119#M622288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're in need of something you could call "Delayed expansion". Meaning that the embedded $-sign construct should be expanded when the expression is evaluated (in a UI object), &lt;EM&gt;not&lt;/EM&gt; when the text is assigned to the expression variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of techniques for avoiding this effect. Sunny has already shown a few. Here are some others:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;An assignment using a LET statement has expansion of embedded $-sign constructs blocked, as soon as even a single space is put between the $-sign and the opening bracket. Usually this means you've got to glue together pieces of a string, like:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vExpression = '=count({&amp;lt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;$' &amp;amp; '(&lt;/STRONG&gt;&lt;/SPAN&gt;vSetSpec)&amp;gt;} LineFlag)';&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;If you use variables (i.e. not strings) to pass around your expressions, no substitution will be performed as the Script engine will only perform substitution on script content, never on variable content&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 14:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-a-variable-in-the-load-script/m-p/1219119#M622288</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-02-06T14:05:51Z</dc:date>
    </item>
  </channel>
</rss>

