<?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: Syntax optimization - aggregate function - Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181399#M1251968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my current mapping :&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture QLIK 3.PNG" class="jive-image image-1" src="/legacyfs/online/137236_Capture QLIK 3.PNG" style="height: 355px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Sep 2016 06:36:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-09-13T06:36:02Z</dc:date>
    <item>
      <title>Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181396#M1251956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;I'm working on &lt;SPAN class="il"&gt;Qlik&lt;/SPAN&gt; and I am facing a huge performance problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;Indeed, I made hard calculations and the application now takes several seconds (or sometimes minutes or total stop) to be updated at every click!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;I spent several days and I can't find a solution so I really need you !!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;I have 3 main tables to calculate the consumption of articles for each finished product in each workshop (by month):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;- 1st table :&amp;nbsp; Consumption &lt;SPAN style="color: #000000; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;(Q = quantity) &lt;/SPAN&gt;by article and by workshop, site, month and year (for example in m3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;- 2nd table : Production &lt;SPAN style="color: #000000; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;(v= volume of processed tons) &lt;/SPAN&gt;of product by workshop, month and year (for example in Tons)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;- 3d table : Theoretical consumption (e_th) by product AND article &lt;SPAN style="color: #000000; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;(for example in m3 / Tons)&lt;/SPAN&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;&amp;nbsp;&amp;nbsp; It's a kind of&amp;nbsp; theoretical bill of materials updated only one time by year . But it's not the true consumption by product...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;&lt;IMG alt="Capture QLIK.PNG" class="jive-image image-1" src="/legacyfs/online/137189_Capture QLIK.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: black;"&gt;and an other table similar to the 1st one with the fix consumption (F= baseline) &lt;SPAN style="color: #000000; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;by article and by workshop, site, month and year &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;So the true consumption by article and by products (q) is not known (we want q = v x e) and I need to calculate it like that :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;e = e_th x&amp;nbsp; &lt;SPAN style="color: #000000; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;(Q - F) / (Qth -F)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;with Qth = SUMPRODUCT(v x e_th)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;I did this calculation. It works but the response time is very high...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SUM(&lt;/P&gt;&lt;P&gt;Aggr($(e_th),[SITE NAME],WORKSHOP, MONTH,ARTICLE,PRODUCT)&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;Aggr($(Q)-$(F),[SITE NAME],WORKSHOP, MONTH,ARTICLE,PRODUCT)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;Aggr(SUM(TOTAL&amp;lt;[SITE NAME],WORKSHOP, MONTH,ARTICLE&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Aggr($(e_th) * SUM({$&amp;lt;YEAR = {$(Year_N)}&amp;gt;}$(v)),[SITE NAME],WORKSHOP, MONTH,ARTICLE,PRODUCT))&lt;/P&gt;&lt;P&gt;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUM({$&amp;lt;YEAR = {$(Year_N)}&amp;gt;}$(F)),[SITE NAME],WORKSHOP, MONTH,ARTICLE,PRODUCT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture Qlik 2.PNG" class="jive-image image-2" src="/legacyfs/online/137190_Capture Qlik 2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;SPAN style="color: black; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;Do you think it's possible to do this calculation &lt;SPAN style="color: #000000; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;STRONG&gt; directly in the script &lt;/STRONG&gt;&lt;/SPAN&gt; to have the table above??&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;If you have any idea please answer... It's will be very helpull !!!!!&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Thanks a lot&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/Syntax-optimization-aggregate-function-Script/m-p/1181396#M1251956</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181397#M1251961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample to look at the issue you are facing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 00:03:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181397#M1251961</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-13T00:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181398#M1251964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sunny T,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick answer.&lt;/P&gt;&lt;P&gt;Unfortunately I can't share the sample...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an idea how I can improve it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 06:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181398#M1251964</guid>
      <dc:creator />
      <dc:date>2016-09-13T06:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181399#M1251968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my current mapping :&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture QLIK 3.PNG" class="jive-image image-1" src="/legacyfs/online/137236_Capture QLIK 3.PNG" style="height: 355px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 06:36:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181399#M1251968</guid>
      <dc:creator />
      <dc:date>2016-09-13T06:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181400#M1251971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try using variables and check &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 06:46:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181400#M1251971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-13T06:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181401#M1251973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not a surprise because of the heavy use of aggr-functions that your expression is slow. I think you need at least some adjustments within the datamodel and maybe even some kind of precalculations. How does your datamodel look like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 07:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181401#M1251973</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-09-13T07:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax optimization - aggregate function - Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181402#M1251974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You used a linktable-datamodel which is from a performance point of view not the best choice - especially with so many aggr-functions you will build several huge virtual tables (which needs time) - see for this: &lt;A href="https://community.qlik.com/qlik-blogpost/3214"&gt;Logical Inference and Aggregations&lt;/A&gt;. Therefore I suggest to change the datamodel into a starscheme or to use only a single fact-table. Here you will find more input: &lt;A href="https://community.qlik.com/qlik-blogpost/3119"&gt;Concatenate vs Link Table&lt;/A&gt; (instead respectively additionally you could use joins or mapping to create the fact-table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 15:24:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-optimization-aggregate-function-Script/m-p/1181402#M1251974</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-09-13T15:24:16Z</dc:date>
    </item>
  </channel>
</rss>

