<?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: Sum total aggr... help to optimize in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099868#M919004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to post a small sample file with expected output to test it out ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you can give a try on the below:&lt;/P&gt;&lt;P&gt;[Column1 ] /&lt;/P&gt;&lt;P&gt;Sum(TOTAL &amp;lt;bu, line, prj, year, month&amp;gt; Aggr(Sum({$&amp;lt;dt_date_end={"=dt_month_cost_end"}&amp;gt;}, quantity))&amp;nbsp;&amp;nbsp; * &lt;/P&gt;&lt;P&gt;sum(distinct {$&amp;lt;dt_month_cost={"=$(V_MAX_DT)"}&amp;gt;},cost_total)),supplier, bu, line, prj, year, month))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 May 2016 14:20:09 GMT</pubDate>
    <dc:creator>trdandamudi</dc:creator>
    <dc:date>2016-05-08T14:20:09Z</dc:date>
    <item>
      <title>Sum total aggr... help to optimize</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099866#M919002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;can anyone help me to optimize - if possible - this expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a pivot, dimensions are:&lt;/P&gt;&lt;P&gt;- supplier, bu, line, prj, year, month&lt;/P&gt;&lt;P&gt;- two expressions are: 1. quantity * cost and 2. % of cost regarding the sum according to dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the first one, I'm ok.&lt;/P&gt;&lt;P&gt;For the second, I use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Column1 ] / &lt;/P&gt;&lt;P&gt;Sum(TOTAL &amp;lt;bu, line, prj, year, month&amp;gt;&lt;/P&gt;&lt;P&gt;Aggr(Sum(if(dt_date_end=dt_month_cost_end, quantity)) * sum(distinct if(dt_month_cost=V_MAX_DT,cost_total)),supplier, bu, line, prj, year, month))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where V_MAX_DT contains the max date where cost is present, calculated in load script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and [Column 1] is &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;quantity * cost_total.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The application is very very slow loading the pivot...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Anyone can help me to optimize this? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Mike&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099866#M919002</guid>
      <dc:creator>mike_spada</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum total aggr... help to optimize</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099867#M919003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this could be optimized by replacing the inner if-condition with a outer if-condition - see: &lt;A href="https://community.qlik.com/message/849846"&gt;Re: Sum(if(...)) vs If(Sum(...), Sum(...))&lt;/A&gt; - and probably some more by replacing it through a set analysis. Therefore try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Column1 ] / &lt;/P&gt;&lt;P&gt;Sum(TOTAL &amp;lt;bu, line, prj, year, month&amp;gt;&lt;/P&gt;&lt;P&gt;Aggr(if(dt_date_end=dt_month_cost_end, Sum(quantity)) *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(dt_month_cost=V_MAX_DT, sum(distinct cost_total)),&lt;/P&gt;&lt;P&gt;supplier, bu, line, prj, year, month))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Column1 ] / &lt;/P&gt;&lt;P&gt;Sum(TOTAL &amp;lt;bu, line, prj, year, month&amp;gt;&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt; dt_date_end = {"=dt_date_end=dt_month_cost_end"}&amp;gt;} quantity) * &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt; dt_month_cost= {"$(V_MAX_DT)"}&amp;gt;} cost_total),&lt;/P&gt;&lt;P&gt;supplier, bu, line, prj, year, month))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 May 2016 14:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099867#M919003</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-08T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum total aggr... help to optimize</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099868#M919004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to post a small sample file with expected output to test it out ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you can give a try on the below:&lt;/P&gt;&lt;P&gt;[Column1 ] /&lt;/P&gt;&lt;P&gt;Sum(TOTAL &amp;lt;bu, line, prj, year, month&amp;gt; Aggr(Sum({$&amp;lt;dt_date_end={"=dt_month_cost_end"}&amp;gt;}, quantity))&amp;nbsp;&amp;nbsp; * &lt;/P&gt;&lt;P&gt;sum(distinct {$&amp;lt;dt_month_cost={"=$(V_MAX_DT)"}&amp;gt;},cost_total)),supplier, bu, line, prj, year, month))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 May 2016 14:20:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099868#M919004</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2016-05-08T14:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sum total aggr... help to optimize</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099869#M919005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot attach a file because of data too private &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'll try your suggest and let you know.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 May 2016 15:05:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099869#M919005</guid>
      <dc:creator>mike_spada</dc:creator>
      <dc:date>2016-05-08T15:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sum total aggr... help to optimize</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099870#M919006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this link which might be able to address your data sensitivity issues while sharing a sample&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-1290"&gt;Preparing examples for Upload - Reduction and Data Scrambling&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 01:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-aggr-help-to-optimize/m-p/1099870#M919006</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-10T01:19:23Z</dc:date>
    </item>
  </channel>
</rss>

