<?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 defined in script not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953089#M327676</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, i am trying this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Nov 2015 14:48:50 GMT</pubDate>
    <dc:creator>felcar2013</dc:creator>
    <dc:date>2015-11-20T14:48:50Z</dc:date>
    <item>
      <title>Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953082#M327669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;hi, i want to get this variable to work in my Expression, but it is not working&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;i defined in the script the variable like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;SET&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vL.CustomerTimestampPrevMonth&lt;/EM&gt;&lt;/STRONG&gt;=chr(39)&amp;amp;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;chr(39);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;and after running the script, i see in the Variable Overview under Settings that the variable is shown as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;chr&lt;/SPAN&gt;(39)&amp;amp;&lt;SPAN style="color: #0000ff;"&gt;date&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;addmonths&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;date#&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;GetFieldSelections&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;KUNDE_ZEITSTEMPEL&lt;/SPAN&gt;),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;&lt;SPAN style="color: #0000ff;"&gt;chr&lt;/SPAN&gt;(39) , which is not working in my Expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;It works when i manually add the " = " sign infront of it in the variable overview. However i cannot get to create the complete variable expression in the script. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I also created this in the script,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;SET&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vL.CustomerTimestampPrevMonth&lt;/EM&gt;&lt;/STRONG&gt;='=chr(39)&amp;amp;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;chr(39)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;but in the varibale overview appears as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/SPAN&gt;=chr(39)&amp;amp;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;chr(39)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;and it is also not working. Any idea why not?&amp;nbsp; (i tried with chr(61) too, same result)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953082#M327669</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2015-11-20T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953083#M327670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried using LET?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;vL.CustomerTimestampPrevMonth&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;"&gt;=chr(39)&amp;amp;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;chr(39);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:15:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953083#M327670</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-20T14:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953084#M327671</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;How you using in the expression?&lt;/P&gt;&lt;P&gt;You Tried &lt;/P&gt;&lt;P&gt;$()&lt;/P&gt;&lt;P&gt;$(=)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:17:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953084#M327671</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2015-11-20T14:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953085#M327672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, did not work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:29:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953085#M327672</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2015-11-20T14:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953086#M327673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, it did not work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953086#M327673</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2015-11-20T14:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953087#M327674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use quite often double-quotes around variable-definitions like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;SET&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;vL.CustomerTimestampPrevMonth&lt;/EM&gt;&lt;/STRONG&gt;=&lt;STRONG&gt;"&lt;/STRONG&gt;=chr(39)&amp;amp;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;chr(39)&lt;STRONG&gt;"&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the suggestion from Mark to use $-sign expansion is often helpful: &lt;A href="https://community.qlik.com/qlik-blogpost/3444"&gt;The Magic of Dollar Expansions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However much easier are pure numeric values to handle. In this case maybe with a additionally field MonthCounter - &lt;A href="https://community.qlik.com/message/563904"&gt;Re: Howto make a variable to calculate quarters regarding year changes?&lt;/A&gt; - which is associated to [customer_timestamp] and then to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set var = "max(MonthCounter)-1";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which avoids the whole formatting-stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953087#M327674</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-20T14:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953088#M327675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HAve you just tried &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set &lt;STRONG style="font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;vL.CustomerTimestampPrevMonth = &lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;"&gt;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you seem to be adding the actual ' symbol in?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe purgechar(&lt;STRONG style="font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;vL.CustomerTimestampPrevMonth,'&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;"&gt;chr(39)'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;) in a text box and see if that is the right result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:42:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953088#M327675</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2015-11-20T14:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953089#M327676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, i am trying this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:48:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953089#M327676</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2015-11-20T14:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953090#M327677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you just want to add the equal sign:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;SET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;vL.CustomerTimestampPrevMonth&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;"&gt;= =chr(39)&amp;amp;date(addmonths(date#(GetFieldSelections(customer_timestamp),'YYYY/MM'),-1),'YYYY/MM')&amp;amp;chr(39);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:51:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953090#M327677</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-11-20T14:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Variable defined in script not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953091#M327678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is right like this, thks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 15:27:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-defined-in-script-not-working/m-p/953091#M327678</guid>
      <dc:creator>felcar2013</dc:creator>
      <dc:date>2015-11-20T15:27:19Z</dc:date>
    </item>
  </channel>
</rss>

