<?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: Less resource intensive expression? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742540#M661426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My understanding is that this information will not change whilst the data has been loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a result I think that I would be tempted to calculate on load by creating the maximum PeriodNumber and Year from the existing sales data table (resident) and store it as a table of CustomerNumber and MaxPeriodNumber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is that you have already gotten to this position already but needed some form of verification ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2015 14:44:17 GMT</pubDate>
    <dc:creator>Roop</dc:creator>
    <dc:date>2015-03-18T14:44:17Z</dc:date>
    <item>
      <title>Less resource intensive expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742539#M661425</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 got an application with around 65mil rows of sales info. These are attached to customers and periods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a table that is calculating a number of fields for customers that have been "lost" - there's a field that gives me the period each account was lost in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table calculates fine even at the highest overall level, except for one expression. This won't load at the highest granularity level, and it's only when I select a member of my sales hierarchy or a region that it produces - it just takes far too long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression is to work out the last period it traded in. There isn't unfortunately a pre-calculated field that measures this (though there remains an option to calculate this in the backend if there are no other fixes), so the expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;PeriodNumber&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;CustomerSales&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;={'&amp;gt;0'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FullPeriod&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The issue is that it's having to search through every single record to find the maxium fullperiod that a record attaches to. The field works, it just won't calculate at the highest level. I ignore the PeriodNumber and Year fields as these are pre-selected by the user and evidently would limit my search to just that period!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;All thoughts welcome. Happy to take this into the load script if so be it, but just wondered if there was a less resource intensive way of calculating the value in the front end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 14:15:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742539#M661425</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2015-03-18T14:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Less resource intensive expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742540#M661426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My understanding is that this information will not change whilst the data has been loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a result I think that I would be tempted to calculate on load by creating the maximum PeriodNumber and Year from the existing sales data table (resident) and store it as a table of CustomerNumber and MaxPeriodNumber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is that you have already gotten to this position already but needed some form of verification ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 14:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742540#M661426</guid>
      <dc:creator>Roop</dc:creator>
      <dc:date>2015-03-18T14:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Less resource intensive expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742541#M661427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty much, but thought I'd throw it out there in case there was a 'simpler' solution, reading this new data in requires a bit of extra formatting and work on the model to attach it how the client was after it, but is probably a worthwhile investment given the situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 08:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742541#M661427</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2015-03-20T08:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Less resource intensive expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742542#M661428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beside a direct pre-calculation within a table in the script it could be that a change from the datamodel (by minimizing hops between tables) could speed up such calculations. Before you should try it with modifications on your expression, maybe something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;firstsortedvalue(FullPeriod, -FullPeriod)&lt;/P&gt;&lt;P&gt;maxstring(Customer&amp;amp;FullPeriod)&lt;/P&gt;&lt;P&gt;subfield(concat(FullPeriod, '-', FullPeriod), '-', -1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with and without set analysis, distinct and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 11:00:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742542#M661428</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-03-20T11:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Less resource intensive expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742543#M661429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd tried the FirstSortedValue route which didn't seem to change the response time. The Maxstring I'd assumed would perform worse as it would be a text comparison, where as I assume it was treating FullPeriod as numeric as it's a 201501 field value for example, but will give it a shot. The subfield is an interesting one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will give it a whirl, but think I'm busy working on the table links now for that solution. Removing the two fields from the set would need a remodel of the way in which all the dates are working, but that may be a direction to travel in anyway - there's already a fair amount of transformation going on and we want this to be a relatively low maintenance change due to other pressures but will take what you've suggested on board. Thankyou.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:57:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Less-resource-intensive-expression/m-p/742543#M661429</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2015-03-20T15:57:40Z</dc:date>
    </item>
  </channel>
</rss>

