<?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 Setting a variable in script... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477920#M694113</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 want to set a varible from code that results in a YTD-like value (in the attached example). I am able to create an expression in a table to get the result. I can also set the variable in the variablescreen and use that to display the desired value, but because of reasons of reusability and the number of variables I need, I want to set the variable in code. This results in an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a lot, but possibly not everything. Maybe some of you guys might be able to come up with a suitable solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, vBeijnen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2013 12:55:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-17T12:55:18Z</dc:date>
    <item>
      <title>Setting a variable in script...</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477920#M694113</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 want to set a varible from code that results in a YTD-like value (in the attached example). I am able to create an expression in a table to get the result. I can also set the variable in the variablescreen and use that to display the desired value, but because of reasons of reusability and the number of variables I need, I want to set the variable in code. This results in an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a lot, but possibly not everything. Maybe some of you guys might be able to come up with a suitable solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, vBeijnen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 12:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477920#M694113</guid>
      <dc:creator />
      <dc:date>2013-06-17T12:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable in script...</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477921#M694114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a difficult matter ... cause are special characters. In most cases it is enough to replace single quotes with double quotes, but here it seems it is the $ sign - see here &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/message/337484#337484" title="http://community.qlik.com/message/337484#337484"&gt;http://community.qlik.com/message/337484#337484&lt;/A&gt; and also the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;set&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: gray;"&gt;vFromScript&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = 'Count({1&amp;lt;Date={"&amp;lt;=#(=max(Date))"}&amp;gt;} Label)';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;let&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: gray;"&gt;vFromScript&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;replace&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;('$(vFromScript)', '#', &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;chr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(36)); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 15:36:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477921#M694114</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-06-17T15:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable in script...</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477922#M694115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vBeijnein&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is beacause of the $ sign in the string&lt;/P&gt;&lt;P&gt;you have to split up your string like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET v = first_part_string &amp;amp; chr(36) &amp;amp; second_part_string&amp;nbsp; : chr(36) for $ sign&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Idem ifyou use simple/double cotes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 15:43:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477922#M694115</guid>
      <dc:creator />
      <dc:date>2013-06-17T15:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable in script...</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477923#M694116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you kindly, Marcus!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 15:47:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477923#M694116</guid>
      <dc:creator />
      <dc:date>2013-06-17T15:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a variable in script...</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477924#M694117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Christianj, Marcus beat you to it... this time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 10:07:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-variable-in-script/m-p/477924#M694117</guid>
      <dc:creator />
      <dc:date>2013-06-18T10:07:12Z</dc:date>
    </item>
  </channel>
</rss>

