<?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: Creating a variable for expression (not working) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904518#M656586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dang. It runs, but just gives me a "0". If I have the same expression in a text box it gives me a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jun 2015 02:06:17 GMT</pubDate>
    <dc:creator>zagzebski</dc:creator>
    <dc:date>2015-06-26T02:06:17Z</dc:date>
    <item>
      <title>Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904513#M656581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create variables for all my commonly used expressions. This is just one example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vFSRevMaxYear = 'Sum({$&amp;lt;[GL Dashboard]={'Revenue'},[Entity Location]={'01-WC,'03-EC'},Calendar_Year={$(=Max(Calendar_Year))}&amp;gt;} [Amount GL])*-1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression doesn't work as I keep getting a "script line error"&amp;nbsp; - is it because of dashes or apostrophes? If so what is the best solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 20:56:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904513#M656581</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2015-06-25T20:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904514#M656582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think some help here&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4232"&gt;Escape sequences&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;Let vFSRevMaxYear = 'Sum({$&amp;lt;[GL Dashboard]={''Revenue''},[Entity Location]={''01-WC'',''03-EC''},Calendar_Year={$(=Max(Calendar_Year))}&amp;gt;} [Amount GL])*-1';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 21:10:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904514#M656582</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-06-25T21:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904515#M656583</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;I suggest you to use chr(39) function whenever you to a single quote in a string or chr(34) for double quotes, escaping it will work too, but sometimes it gets messy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ryuma Nakano.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 21:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904515#M656583</guid>
      <dc:creator />
      <dc:date>2015-06-25T21:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904516#M656584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It didn't give me an error when I did what you recommended,&amp;nbsp; but the variable returns a "0" instead of the correct amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 21:31:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904516#M656584</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2015-06-25T21:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904517#M656585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like that, if I didn't miss anything:&lt;/P&gt;&lt;P&gt;Let vFSRevMaxYear = 'Sum({$&amp;lt;[GL Dashboard]={' &amp;amp;chr(39)&amp;amp;&amp;nbsp; 'Revenue'&amp;nbsp; &amp;amp;chr(39) &amp;amp; '},[Entity Location]={'&amp;nbsp; &amp;amp;chr(39) &amp;amp; '01-WC'&amp;nbsp; &amp;amp;chr(39) &amp;amp; ','&amp;nbsp; &amp;amp;chr(39) &amp;amp; '03-EC'&amp;nbsp; &amp;amp;chr(39) &amp;amp; '},Calendar_Year={$(=Max(Calendar_Year))}&amp;gt;} [Amount GL])*-1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; a way to test is to put this into a text box and see if it builds what you need:&lt;/P&gt;&lt;P&gt;= 'Sum({$&amp;lt;[GL Dashboard]={' &amp;amp;chr(39)&amp;amp;&amp;nbsp; 'Revenue'&amp;nbsp; &amp;amp;chr(39) &amp;amp; '},[Entity Location]={'&amp;nbsp; &amp;amp;chr(39) &amp;amp; '01-WC'&amp;nbsp; &amp;amp;chr(39) &amp;amp; ','&amp;nbsp; &amp;amp;chr(39) &amp;amp; '03-EC'&amp;nbsp; &amp;amp;chr(39) &amp;amp; '},Calendar_Year={$(=Max(Calendar_Year))}&amp;gt;} [Amount GL])*-1'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 01:01:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904517#M656585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-26T01:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904518#M656586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dang. It runs, but just gives me a "0". If I have the same expression in a text box it gives me a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 02:06:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904518#M656586</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2015-06-26T02:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a variable for expression (not working)</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904519#M656587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope you run it on the front end, not in the script.&lt;/P&gt;&lt;P&gt;Anyway, it's one thing to build this variable but another is to test the expression itself.&amp;nbsp; You have to upload your app for that sort of help.&amp;nbsp; Syntax looks fine to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 02:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-variable-for-expression-not-working/m-p/904519#M656587</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-26T02:10:27Z</dc:date>
    </item>
  </channel>
</rss>

