<?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: Caching variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112862#M1292092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your very valuable inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could test what Mike Wang said, and it's true! If I have two similar expressions, the object calculation time is twice the time as if I just had one expression. Even if the expression is exactly the same (copied - pasted). If second expression is just a reference to the first one (Column(1)), time it's the same as if I just had one expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that storing an expression in a variable doesn't make its calculation to be cached for further uses of it as a part of other larger expressions. &lt;SPAN style="font-size: 10pt;"&gt;So my question gets totally asked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'll get a mixed approach: I'll use variables to encapsulate expressions but I'll keep using Column(x) to prevent QlikView from calculated same thing twice.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2018 16:32:05 GMT</pubDate>
    <dc:creator>ramonarcusa36</dc:creator>
    <dc:date>2018-11-07T16:32:05Z</dc:date>
    <item>
      <title>Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112856#M1292085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple question about performance and variable caching. Let's suppose I have these two expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expr1: Sum(Units)&lt;/P&gt;&lt;P&gt;Expr2: Sum(Dollars)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, let's suppose I want to calculate a third expressión: Price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expr3: Sum(Dollars) / Sum(Units)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I'm concerned, if I want optimum performance I would write the third expression like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expr3: Column(2) / Column(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then, QlikView would just use the previously calculated expressions (Expr1 and Expr2), optimizing performance (labeled aliases would also do the trick).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what happens if I use variables? Let's suppose this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expr1: $(vAmountOfUnits)&lt;/P&gt;&lt;P&gt;Expr2: $(vDollars)&lt;/P&gt;&lt;P&gt;Expr3: &lt;SPAN style="font-size: 13.3333px;"&gt;$(vDollars) / &lt;SPAN style="font-size: 13.3333px;"&gt;$(vAmountOfUnits)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;In the third expression, would QlikView use the previously cached $(vAmountOfUnits) and $(vDollars)? Or since it's a totally different expression (even if it contains parts of previous ones) it would have to calculate units and dollars again? (Obviously, I know I could go with the Column(x) approach here too, but my real situation is far more complex than this; this is just a very simple example to find out how QlikView deals with variables and caches).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112856#M1292085</guid>
      <dc:creator>ramonarcusa36</dc:creator>
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112857#M1292087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from below post, i believe it does as long as same dimensions are used.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3679"&gt;The QlikView Cache&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/2286"&gt;rwunderlich&lt;/A&gt;‌ your thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 21:12:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112857#M1292087</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2018-11-06T21:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112858#M1292088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my testing I find that there is no performance benefit to using the column(n) / column(n) method.&amp;nbsp; Although the doc &lt;A href="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/InterRecordFunctions/column.htm" title="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/InterRecordFunctions/column.htm"&gt;https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/InterRecordFunctions/column.h…&lt;/A&gt; states "Column() returns the value found in the column " I believe it actually reuses the expression text found in the column, not the calculated value.&amp;nbsp; The benefit is in maintainabilty of the chart, not performance.&amp;nbsp; I'd be happy to hear arguments and examples to the contrary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards to the "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;$(vDollars) / &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(vAmountOfUnits)" variable question.&amp;nbsp; To my knowledge and observations, QV does not cache expression results or fragments, it caches full chart results.&amp;nbsp; Therefore "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;$(vDollars)" being calculated earlier in the chart will not be reused in a "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;$(vDollars) / &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(vAmountOfUnits)" expression. it is an entirely new expression from the standpoint of cache.&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Further, my experience is that &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;$(vDollars) / &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(vAmountOfUnits)" will not match to the cached version of "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum(Dollars) / Sum(Units)" even though after DSE they are the same expression. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I find the same observations with the Qlik Sense client.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Interestingly, when using the Qlik Sense API "createSessionObject()" the variable version does seem to be equivalent to to the text version. it appears that cache identity when using the API is done post DSE. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I'll admit to some mysteries here and welcome comments from those who have more knowledge of the internals or have measured results contrary to mine. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.easyqlik.com" rel="nofollow" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 02:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112858#M1292088</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-11-07T02:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112859#M1292089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tried the Column() expression and I am pretty certain it uses the value found in the column rather than reusing the expression text. Here is what I tried:&lt;/P&gt;&lt;P&gt;Test: LOAD 1 as A, 2 as B AutoGenerate 1; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Straight Table Chart:&lt;/P&gt;&lt;P&gt;Dimension: A&lt;/P&gt;&lt;P&gt;Expressions...&lt;/P&gt;&lt;P&gt;Exp: =SUM(AGGR(SUM(B),A))+SUM(AGGR(SUM(B),A))+....+SUM(AGGR(SUM(B),A))&lt;/P&gt;&lt;P&gt;Exp2: = same as Exp&lt;/P&gt;&lt;P&gt;Col: =Column(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The +SUM(AGGR(SUM(B),A)) was repeated 3500 times to create an expression that is difficult to cache. (the SUM(AGGR(SUM(B),A)) are cached individually, but 3500 cache pulls need to be done separately.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calc time with Exp and Exp2: 9703&lt;/P&gt;&lt;P&gt;Calc time with Exp and Col: 2100&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 02:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112859#M1292089</guid>
      <dc:creator>mikevwang</dc:creator>
      <dc:date>2018-11-07T02:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112860#M1292090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;Can you confirm that you repeated your test by calculating each chart as the first calculation?&amp;nbsp; ie Chart A followed by Chart B, then Chart B followed by Chart A? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 12:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112860#M1292090</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-11-07T12:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112861#M1292091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I have tried in reverse order and also tried removing impact of any carryover caching by saving on blank sheet and then restarting QV completely before measuring each change. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 13:03:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112861#M1292091</guid>
      <dc:creator>mikevwang</dc:creator>
      <dc:date>2018-11-07T13:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Caching variables</title>
      <link>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112862#M1292092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your very valuable inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could test what Mike Wang said, and it's true! If I have two similar expressions, the object calculation time is twice the time as if I just had one expression. Even if the expression is exactly the same (copied - pasted). If second expression is just a reference to the first one (Column(1)), time it's the same as if I just had one expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that storing an expression in a variable doesn't make its calculation to be cached for further uses of it as a part of other larger expressions. &lt;SPAN style="font-size: 10pt;"&gt;So my question gets totally asked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'll get a mixed approach: I'll use variables to encapsulate expressions but I'll keep using Column(x) to prevent QlikView from calculated same thing twice.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 16:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Caching-variables/m-p/112862#M1292092</guid>
      <dc:creator>ramonarcusa36</dc:creator>
      <dc:date>2018-11-07T16:32:05Z</dc:date>
    </item>
  </channel>
</rss>

