<?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: Calculated Dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799294#M282229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;HI syed&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;hope you help this&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;To make a chart in QlikView – in any Business Intelligence tool, for that matter – you need to have one or several dimensions; entities with discrete values that you use as grouping symbols. But where should you define these dimensions: In the script or in the object where the dimension is used?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;In most cases, you will use an existing field as dimension, i.e. an attribute that exists in the source data. In such a case, the answer to the above question is easy: Just make sure to load the field in the script, and you're done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;But in some cases you want to use derived attributes: Attributes that do not exist in the source data but one way or another can be calculated from existing fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;One example is the fields of the Master Calendar: Year, Month, etc. These can all be derived from a date found in the source data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Month&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Date&lt;/SPAN&gt;) &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Year&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Date&lt;/SPAN&gt;) &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;A more advanced example is if you want to classify or rank a field. The following expression returns ‘A’ for the 10 best customers and a ‘B’ for the rest:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Rank&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Sales&lt;/SPAN&gt;)),&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Customer&lt;/SPAN&gt;)&amp;lt;=10,'A','B')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;For such fields the above question is very relevant: Should they be calculated in the script and saved as fields, or should they be calculated on the fly in a sheet object?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: center; background-color: #f5faf0;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/38-3676-56831/Image2.png" style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #3778c7;"&gt;&lt;IMG alt="Image2.png" class="jive-image jiveImage" height="286" src="https://community.qlik.com/legacyfs/online/71863_Image2.png" style="border: 0px; font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit;" width="490" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;There are pro:s and con:s with both approaches: A field calculated in the script is calculated once and for all, so it does not need to be re-calculated every time the user clicks. Hence, response times will be slightly shorter if the field is calculated in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;On the other hand, in some cases you &lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;want&lt;/EM&gt; the field to be re-calculated every time the user clicks. A good example is the classification using Rank() above. Most likely you want this field to depend on the selection made: If you have selected a product, you want to see the classification of the customers given this selection. Such a number is in its nature dynamic and should be calculated every time the user clicks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;The key is whether the calculated field should be &lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;static&lt;/EM&gt; or &lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;dynamic&lt;/EM&gt;. The field Month is static: A specific date always belongs to the same month, irrespective of user selection. As opposed to a classification or a rank where the calculation usually should be dynamic, since the result potentially could change every time the user clicks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;Bottom line is that dynamic fields must be calculated in the chart or the list box. But for static fields it is better if they are calculated in the script, since precious CPU-time otherwise will be unnecessarily spent every time the user clicks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-link-profile-small" data-containerid="-1" data-containertype="-1" data-objectid="4003" data-objecttype="3" href="https://community.qlik.com/people/hic/content" style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #3778c7;"&gt;HIC&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;Note: The Rank() function cannot be used in the script, so if you want to calculate a static rank in the script, you need to do it in a different way, using e.g. a combination of Order By and RecNo().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Nov 2014 00:20:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-22T00:20:56Z</dc:date>
    <item>
      <title>Calculated Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799289#M282224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends&lt;/P&gt;&lt;P&gt;I have a dimension in my Pivot table called &lt;STRONG&gt;Account&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It has account numbers as values that start with 1, 2, 3, 4...8&lt;/P&gt;&lt;P&gt;I want to filter it in such a way that it shows only account numbers that begin with 4 in my pivot chart.&lt;/P&gt;&lt;P&gt;Please tell me what is the best way to do it.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rizwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 17:39:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799289#M282224</guid>
      <dc:creator />
      <dc:date>2014-11-21T17:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799290#M282225</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;you use set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #312e25; font-family: monospace; font-size: 11px; line-height: 1.5em; background-color: #f5f3e5;"&gt;Sum({$&amp;lt;account=P({1&amp;lt;={"$(=4)*"}&amp;gt;}account)&amp;gt;}Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #312e25; font-family: monospace; font-size: 11px; line-height: 1.5em; background-color: #f5f3e5;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #312e25; font-family: monospace; font-size: 11px; line-height: 1.5em; background-color: #f5f3e5;"&gt;Hope it helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #312e25; font-family: monospace; font-size: 11px; line-height: 1.5em; background-color: #f5f3e5;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #312e25; font-family: monospace; font-size: 11px; line-height: 1.5em; background-color: #f5f3e5;"&gt;André Gomes&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 17:54:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799290#M282225</guid>
      <dc:creator>agomes1971</dc:creator>
      <dc:date>2014-11-21T17:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799291#M282226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andre&lt;/P&gt;&lt;P&gt;What is Sales in  here? Is there any other way than Set Analysis. I am&lt;/P&gt;&lt;P&gt;trying to just write a Calculated Dimension.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Fri, Nov 21, 2014 at 9:55 AM, Andre Gomes &amp;lt;qcwebmaster@qlikview.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 17:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799291#M282226</guid>
      <dc:creator />
      <dc:date>2014-11-21T17:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799292#M282227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can generally do this in the calcualted dimension expression or in the chart expressions with set analysis or if statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to do it in a calcualted dimension, below is an example using if().&amp;nbsp; Note that you need to suppress the NULLs which will catch all the accounts that don't begin with 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/71856_Untitled.png" style="width: 620px; height: 350px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 18:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799292#M282227</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-11-21T18:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799293#M282228</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;if there are more than one expressions, it might be easier to just create one calculated dimension, e.g. like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_143164_Pic1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/71871_QlikCommunity_Thread_143164_Pic1.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_143164_Pic2.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/71872_QlikCommunity_Thread_143164_Pic2.JPG.jpg" style="width: 620px; height: 240px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_143164_Pic3.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/71873_QlikCommunity_Thread_143164_Pic3.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Nov 2014 00:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799293#M282228</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-11-22T00:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799294#M282229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;HI syed&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;hope you help this&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;To make a chart in QlikView – in any Business Intelligence tool, for that matter – you need to have one or several dimensions; entities with discrete values that you use as grouping symbols. But where should you define these dimensions: In the script or in the object where the dimension is used?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;In most cases, you will use an existing field as dimension, i.e. an attribute that exists in the source data. In such a case, the answer to the above question is easy: Just make sure to load the field in the script, and you're done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;But in some cases you want to use derived attributes: Attributes that do not exist in the source data but one way or another can be calculated from existing fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;One example is the fields of the Master Calendar: Year, Month, etc. These can all be derived from a date found in the source data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Month&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Date&lt;/SPAN&gt;) &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Year&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Date&lt;/SPAN&gt;) &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;A more advanced example is if you want to classify or rank a field. The following expression returns ‘A’ for the 10 best customers and a ‘B’ for the rest:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Rank&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Sales&lt;/SPAN&gt;)),&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #800000;"&gt;Customer&lt;/SPAN&gt;)&amp;lt;=10,'A','B')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;For such fields the above question is very relevant: Should they be calculated in the script and saved as fields, or should they be calculated on the fly in a sheet object?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: center; background-color: #f5faf0;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/38-3676-56831/Image2.png" style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #3778c7;"&gt;&lt;IMG alt="Image2.png" class="jive-image jiveImage" height="286" src="https://community.qlik.com/legacyfs/online/71863_Image2.png" style="border: 0px; font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit;" width="490" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;There are pro:s and con:s with both approaches: A field calculated in the script is calculated once and for all, so it does not need to be re-calculated every time the user clicks. Hence, response times will be slightly shorter if the field is calculated in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;On the other hand, in some cases you &lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;want&lt;/EM&gt; the field to be re-calculated every time the user clicks. A good example is the classification using Rank() above. Most likely you want this field to depend on the selection made: If you have selected a product, you want to see the classification of the customers given this selection. Such a number is in its nature dynamic and should be calculated every time the user clicks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;The key is whether the calculated field should be &lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;static&lt;/EM&gt; or &lt;EM style="font-weight: inherit; font-size: 12.7272720336914px; font-family: inherit;"&gt;dynamic&lt;/EM&gt;. The field Month is static: A specific date always belongs to the same month, irrespective of user selection. As opposed to a classification or a rank where the calculation usually should be dynamic, since the result potentially could change every time the user clicks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;Bottom line is that dynamic fields must be calculated in the chart or the list box. But for static fields it is better if they are calculated in the script, since precious CPU-time otherwise will be unnecessarily spent every time the user clicks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-link-profile-small" data-containerid="-1" data-containertype="-1" data-objectid="4003" data-objecttype="3" href="https://community.qlik.com/people/hic/content" style="font-weight: inherit; font-style: inherit; font-size: 12.7272720336914px; font-family: inherit; color: #3778c7;"&gt;HIC&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;Note: The Rank() function cannot be used in the script, so if you want to calculate a static rank in the script, you need to do it in a different way, using e.g. a combination of Order By and RecNo().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Nov 2014 00:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension/m-p/799294#M282229</guid>
      <dc:creator />
      <dc:date>2014-11-22T00:20:56Z</dc:date>
    </item>
  </channel>
</rss>

