<?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: $ expansion not working on a Variable in the Load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698944#M252336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But if you do that, QlikView wins, and we can't allow that &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vTemp = 'sum({&amp;lt;Year={$';&lt;/P&gt;&lt;P&gt;LET vTemp = vTemp &amp;amp; '(=Only(Year))}&amp;gt;}LineSalesAmount)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Sep 2014 20:00:02 GMT</pubDate>
    <dc:creator>vgutkovsky</dc:creator>
    <dc:date>2014-09-15T20:00:02Z</dc:date>
    <item>
      <title>$ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698938#M252330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;I have a bunch of variables that I have moved from the variable overview screen (where I initially created them) to the Script. I was thinking this would allow for easier maintenance.&lt;/P&gt;&lt;P&gt;The variables however so not work once in the script.&lt;/P&gt;&lt;P&gt;The variable in the Variable overview screen is: &lt;EM&gt;&lt;STRONG&gt;sum({&amp;lt;Year = {$(=Only(Year)-1)}&amp;gt;}LineSalesAmount)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In the script it's: &lt;STRONG&gt;&lt;EM&gt;set vTemp = sum({&amp;lt;Year = {$(=Only(Year))}&amp;gt;}LineSalesAmount);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result when in variable overview is correct, gives you last year's sum.&lt;/P&gt;&lt;P&gt;The result when in the script is wrong! for some reason it puts in a blank (like it never saw the $ expansion) in the year dimension (I found this by&amp;nbsp; looking at the variable overview screen).&lt;/P&gt;&lt;P&gt;So when placed in the script QV thinks the variable is: &lt;EM&gt;&lt;STRONG&gt;sum({&amp;lt;Year = {}&amp;gt;}LineSalesAmount)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;so apparently it's ignoring the $ expansion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mystery? am I doing something wrong? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 13:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698938#M252330</guid>
      <dc:creator />
      <dc:date>2014-09-15T13:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698939#M252331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In script, you can't use Set Analysis...&lt;/P&gt;&lt;P&gt;This is not allowed...&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;{&amp;lt;Year = {$(=Only(Year))}&amp;gt;}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 13:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698939#M252331</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-09-15T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698940#M252332</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;Try that, it will make the function to be calculated in each selection (you dont need to use the expansion $ symbol):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;set vTemp = = sum({&amp;lt;Year = {$(=Only(Year))}&amp;gt;}LineSalesAmount);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 13:08:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698940#M252332</guid>
      <dc:creator />
      <dc:date>2014-09-15T13:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698941#M252333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seemed to work, but I can't tell why the numbers aren't adding up. The formula says it's previous year, but the actual value is this year (or ignoring the set analysis).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check attached sample&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 17:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698941#M252333</guid>
      <dc:creator />
      <dc:date>2014-09-15T17:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698942#M252334</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;use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vTemp = '=sum({&amp;lt;Year = {"'&amp;nbsp; &amp;amp; chr(36) &amp;amp; '(=Only(Year)-1)"}&amp;gt;}Sales)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in script. Problem here is that qlikview tries to evaluate the code after the $. Therefore replace it with it's ascii code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 18:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698942#M252334</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-15T18:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698943#M252335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;nope, didn't work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;I think i'll just out the variables back into the variable overview screen and call it a day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 19:47:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698943#M252335</guid>
      <dc:creator />
      <dc:date>2014-09-15T19:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698944#M252336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But if you do that, QlikView wins, and we can't allow that &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vTemp = 'sum({&amp;lt;Year={$';&lt;/P&gt;&lt;P&gt;LET vTemp = vTemp &amp;amp; '(=Only(Year))}&amp;gt;}LineSalesAmount)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 20:00:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698944#M252336</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-09-15T20:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698945#M252337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it does?!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 20:02:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698945#M252337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-15T20:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698946#M252338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vTemp2 = replace ('sum({&amp;lt;Year = {@(=Only(Year))}&amp;gt;} Sales)', '@', '$');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 20:24:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698946#M252338</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-09-15T20:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: $ expansion not working on a Variable in the Load script</title>
      <link>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698947#M252339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must've had a typo. Looks like it works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 20:38:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expansion-not-working-on-a-Variable-in-the-Load-script/m-p/698947#M252339</guid>
      <dc:creator />
      <dc:date>2014-09-15T20:38:36Z</dc:date>
    </item>
  </channel>
</rss>

