<?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 Problems with defined variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616452#M1103365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This a general question because it happen sometimes and I don't know how and why it happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the question:&lt;/P&gt;&lt;P&gt;Suppose you define 2 variables v1 and v2 using the input box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are times when you type in ($(v1)) / ($(v2)) [That's v1 divided by v2] as an expression in a chart, there is no result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you type try to replace one of the variables with the actual formula, then it works.&lt;/P&gt;&lt;P&gt;(e.g. let's say v2 = formula2. Then if I change the expression to $(v1)/(formula2) it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry if this question is not clearly stated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wondering if anyone have similar problem before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2014 02:24:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-25T02:24:12Z</dc:date>
    <item>
      <title>Problems with defined variables</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616452#M1103365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This a general question because it happen sometimes and I don't know how and why it happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the question:&lt;/P&gt;&lt;P&gt;Suppose you define 2 variables v1 and v2 using the input box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are times when you type in ($(v1)) / ($(v2)) [That's v1 divided by v2] as an expression in a chart, there is no result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you type try to replace one of the variables with the actual formula, then it works.&lt;/P&gt;&lt;P&gt;(e.g. let's say v2 = formula2. Then if I change the expression to $(v1)/(formula2) it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry if this question is not clearly stated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wondering if anyone have similar problem before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 02:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616452#M1103365</guid>
      <dc:creator />
      <dc:date>2014-03-25T02:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with defined variables</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616453#M1103366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure on your specific example without knowing the content of your variables, but here's a general explanation that may help you understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $() causes the variable to be evaluated before substitution. So&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;&amp;nbsp; $(v1)) / ($(v2)&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: 12.727272033691406px;"&gt;means the result of v1 divided by the result of v2. By contrast&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; v1 / v2&lt;/P&gt;&lt;P&gt;means the contents (as a string) of v1 divided by the contents of v2.&amp;nbsp; So a chart dimension X with a value of 6 and:&lt;/P&gt;&lt;P&gt;&amp;nbsp; v1 = 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; v2 = X * 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(v1) + $(v2)&amp;nbsp; =&amp;nbsp; 2 + 6 * 2&amp;nbsp; =&amp;nbsp;&amp;nbsp; 14&lt;/P&gt;&lt;P&gt;v1 + v2&amp;nbsp;&amp;nbsp; =&amp;nbsp; 2 + 'X' * 2&amp;nbsp; = null&lt;/P&gt;&lt;P&gt;v1 + $(v2)&amp;nbsp; =&amp;nbsp; 2 + 6 * 2&amp;nbsp; =&amp;nbsp;&amp;nbsp; 14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it doesn't quite explain your particular example, maybe you can post some example variables.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 04:09:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616453#M1103366</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-03-25T04:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with defined variables</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616454#M1103367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to reproduce your concern, but was not able to. Can you share a specific scenario in which you came across this.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Angad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 05:20:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616454#M1103367</guid>
      <dc:creator />
      <dc:date>2014-03-25T05:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with defined variables</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616455#M1103368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I face similar situation today. And I found that my situation here related to the comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, you have a variable v1, if you write a formula and then followed by a comment out formula like this:&lt;/P&gt;&lt;P&gt;(some formula)&lt;/P&gt;&lt;P&gt;//(some formula)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use the variable alone in the expressions, it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you use the variable with other variables like ($(1))/($(v2)), it will not work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to change the order of the normal formula and comment out formula in order to make it work:&lt;/P&gt;&lt;P&gt;//(some formula)&lt;/P&gt;&lt;P&gt;(some formula)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 04:21:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616455#M1103368</guid>
      <dc:creator />
      <dc:date>2014-04-11T04:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with defined variables</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616456#M1103369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's interesting. It kind of makes sense, and kind of not. If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v1 = 4 // this is a comment&lt;/P&gt;&lt;P&gt;v2 = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(v1) / $(v2) = 4 because the comment is included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However.&lt;/P&gt;&lt;P&gt;$(v1) = 4.&amp;nbsp; The comment does not appear in final result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 21:10:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-with-defined-variables/m-p/616456#M1103369</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-04-25T21:10:36Z</dc:date>
    </item>
  </channel>
</rss>

