<?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 for a complex calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481286#M1128678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the quick reply swuehl&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;.I need to use the total value for calculation in the next column of the table, so total mode wouldnot help me.I will check out the advanced aggregation in help.I always thought aggregation is performed based on grouping of a particular dimension.Here,I dont require any grouping too.Thanks again.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Dec 2013 10:47:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-12-13T10:47:55Z</dc:date>
    <item>
      <title>Sum total for a complex calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481284#M1128676</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 have this complex calculation in a pivot/straight chart and I cannot find the sum TOTAL for the whole column with all the trials I have made within my knowledge...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is my calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;len([SalesInvHeader.Sell-to Customer Name])&amp;gt;0 and [SalesInvHeader.Payment Terms Code]&amp;lt;&amp;gt;'PP' and SalesInvLine.Type=2 or [SalesInvLine.Prepayment Line]=1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[CustLedgerEntry.Sales (LCY)] - &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(Sum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;( if(CustLedgerEntry.DueDays&amp;gt;[SalesInvHeader.Payment Terms Code],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([CustLedgerEntry.Sales (LCY)] * ([SalesInvHeader.Payment Terms Code]*(0.25/365))) + &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;([CustLedgerEntry.Sales (LCY)] *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (CustLedgerEntry.OverDueDays*(0.5/365))),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CustLedgerEntry.Sales (LCY)] * (CustLedgerEntry.DueDays*(0.25/365))))&lt;/P&gt;&lt;P&gt; + sum(SalesInvLine.COGS)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing I need to do is ideally enclose the whole expression in a sum(TOTAL expr) but it doesnot work.I know it looks complicated but the logic is simple.It calculates the profitability of a customer.I calculates sum for the line level but not as a whole.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please please help me out.Thanks a million in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Naima&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 10:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481284#M1128676</guid>
      <dc:creator />
      <dc:date>2013-12-13T10:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sum total for a complex calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481285#M1128677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the total mode 'sum of rows' in a straight table, and in a pivot table, look into 'sum of rows using advanced aggregation' (a chapter in the HELP file).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 10:43:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481285#M1128677</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-13T10:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sum total for a complex calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481286#M1128678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the quick reply swuehl&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;.I need to use the total value for calculation in the next column of the table, so total mode wouldnot help me.I will check out the advanced aggregation in help.I always thought aggregation is performed based on grouping of a particular dimension.Here,I dont require any grouping too.Thanks again.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 10:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-total-for-a-complex-calculation/m-p/481286#M1128678</guid>
      <dc:creator />
      <dc:date>2013-12-13T10:47:55Z</dc:date>
    </item>
  </channel>
</rss>

