<?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 Expression Variables - Performance comparison in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454162#M1163563</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've created a variable called, say, eAllSales and defined it as =Sum(Sales).&lt;/P&gt;&lt;P&gt;There are 2 ways of using this variable in other expressions and both return the same answer:-&lt;/P&gt;&lt;P&gt;$(=&lt;EM&gt;eAllSales&lt;/EM&gt;) and &lt;EM&gt;eAllSales&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is do with performance.&lt;/P&gt;&lt;P&gt;Every time I click and change list box values the value of the expression variable changes, as expected. But, what I'm needing to know is what is happening under the hood when I use $(=&lt;EM&gt;eAllSales&lt;/EM&gt;) and &lt;EM&gt;eAllSales&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Whenever a change is made, the expression Sum(Sales) gets re-calculated and the variable eSumSales gets updated with this result.&lt;/P&gt;&lt;P&gt;If I use &lt;EM&gt;eAllSales&lt;/EM&gt;, does the current value in &lt;EM&gt;eAllSales&lt;/EM&gt; get returned (or does the expression Sum(Sales) have to be calculated again before returning the result).&lt;/P&gt;&lt;P&gt;Similarly with $(=&lt;EM&gt;eAllSales&lt;/EM&gt;), does the current value itself get returned (or does the expression Sum(Sales) have to be calculated again before returning the result).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this in a number of places within the same sheet and I'm hoping the variable gets updated only once, whenever changes are made, and calling the variable doesn't incur any overhead of having to re-evaluate every time it is referenced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help in this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2012 14:31:31 GMT</pubDate>
    <dc:creator>kevpickering</dc:creator>
    <dc:date>2012-10-25T14:31:31Z</dc:date>
    <item>
      <title>Expression Variables - Performance comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454162#M1163563</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've created a variable called, say, eAllSales and defined it as =Sum(Sales).&lt;/P&gt;&lt;P&gt;There are 2 ways of using this variable in other expressions and both return the same answer:-&lt;/P&gt;&lt;P&gt;$(=&lt;EM&gt;eAllSales&lt;/EM&gt;) and &lt;EM&gt;eAllSales&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is do with performance.&lt;/P&gt;&lt;P&gt;Every time I click and change list box values the value of the expression variable changes, as expected. But, what I'm needing to know is what is happening under the hood when I use $(=&lt;EM&gt;eAllSales&lt;/EM&gt;) and &lt;EM&gt;eAllSales&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Whenever a change is made, the expression Sum(Sales) gets re-calculated and the variable eSumSales gets updated with this result.&lt;/P&gt;&lt;P&gt;If I use &lt;EM&gt;eAllSales&lt;/EM&gt;, does the current value in &lt;EM&gt;eAllSales&lt;/EM&gt; get returned (or does the expression Sum(Sales) have to be calculated again before returning the result).&lt;/P&gt;&lt;P&gt;Similarly with $(=&lt;EM&gt;eAllSales&lt;/EM&gt;), does the current value itself get returned (or does the expression Sum(Sales) have to be calculated again before returning the result).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this in a number of places within the same sheet and I'm hoping the variable gets updated only once, whenever changes are made, and calling the variable doesn't incur any overhead of having to re-evaluate every time it is referenced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help in this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 14:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454162#M1163563</guid>
      <dc:creator>kevpickering</dc:creator>
      <dc:date>2012-10-25T14:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Variables - Performance comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454163#M1163564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the "=" is part of the variable defintion, it will be evaluated only once -- each time selections change. The value of the variable will then be a number, like 123.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the variable reference directly:&lt;/P&gt;&lt;P&gt;eAllSales&lt;/P&gt;&lt;P&gt;you are just substituting 123 into the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you reference the var with an = like:&lt;/P&gt;&lt;P&gt;=eAllSales&lt;/P&gt;&lt;P&gt;you are causing =123 to be evaluated. That's an unnecessary evaluation, but may not be enough to notice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 14:37:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454163#M1163564</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-25T14:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Variables - Performance comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454164#M1163565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob, very quick reply, appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to be clear.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Set modifiers I have to use syntax Max({$&amp;lt;Sales={$(&lt;EM&gt;eAllSales&lt;/EM&gt;)}&amp;gt; field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this syntax, 123 is returned but is it after evaluating Sum(Sales) again (which is how the variable eAllSales is defined), or does it simply reference the variable and return it's content without evaluating Sum(Sales).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 15:06:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454164#M1163565</guid>
      <dc:creator>kevpickering</dc:creator>
      <dc:date>2012-10-25T15:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Variables - Performance comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454165#M1163566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on the defintion eAllSales. If the def is&lt;/P&gt;&lt;P&gt;sum(Sales)&lt;/P&gt;&lt;P&gt;it will be evaluated in the chart expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the def is&lt;/P&gt;&lt;P&gt;=sum(Sales)&lt;/P&gt;&lt;P&gt;it will be evaluated once and the value 123 will be substitued in the expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a performance difference, but also a logic difference. If you want to evaluate per dimension, you need to define it without the = and evaluate in the&amp;nbsp; chart. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 15:47:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variables-Performance-comparison/m-p/454165#M1163566</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-25T15:47:54Z</dc:date>
    </item>
  </channel>
</rss>

