<?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: Calculate subtotal, total in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551016#M688198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;try the following as your expression: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;//0 = grand total&lt;/P&gt;&lt;P&gt;dimensionality() &amp;gt; 0&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;sum(distinct amount)&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;sum(aggr(sum(DISTINCT amount), Category))&lt;/P&gt;&lt;P&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;On a detail-level you only have one amount, so that will stay unchanged.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;On category-level a sum will be made on the distinct values within that category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;On the grand total the sum(aggr(... will make the summation of the category-level subtotals&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Nov 2013 16:22:16 GMT</pubDate>
    <dc:creator>matthias_v</dc:creator>
    <dc:date>2013-11-20T16:22:16Z</dc:date>
    <item>
      <title>Calculate subtotal, total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551013#M688195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;according to the attached file : i want to calculate the subtotal for each category but the problem is that if the sub categories have the same value then the category also must have this value and if sub-categories have different values then the category must be the sum of them.&lt;/P&gt;&lt;P&gt;so in this exemple :&lt;/P&gt;&lt;P&gt;category 1 subtotal must be 5 and category 2 subtotal = 7 (3+4) and the total 12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 10:52:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551013#M688195</guid>
      <dc:creator>mambi</dc:creator>
      <dc:date>2013-11-20T10:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate subtotal, total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551014#M688196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get the subtotals the way you want it by using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Count(distinct amount)=1,Only(amount),sum(amount))&lt;/P&gt;&lt;P&gt;but the total will still be 22. I do not think it is possible to get the total the way you want it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 13:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551014#M688196</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-11-20T13:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate subtotal, total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551015#M688197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can i use Dimensionality() ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 16:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551015#M688197</guid>
      <dc:creator>mambi</dc:creator>
      <dc:date>2013-11-20T16:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate subtotal, total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551016#M688198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;try the following as your expression: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;//0 = grand total&lt;/P&gt;&lt;P&gt;dimensionality() &amp;gt; 0&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;sum(distinct amount)&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;sum(aggr(sum(DISTINCT amount), Category))&lt;/P&gt;&lt;P&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;On a detail-level you only have one amount, so that will stay unchanged.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;On category-level a sum will be made on the distinct values within that category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;On the grand total the sum(aggr(... will make the summation of the category-level subtotals&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 16:22:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551016#M688198</guid>
      <dc:creator>matthias_v</dc:creator>
      <dc:date>2013-11-20T16:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate subtotal, total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551017#M688199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for you help Sir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 18:26:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-subtotal-total/m-p/551017#M688199</guid>
      <dc:creator>mambi</dc:creator>
      <dc:date>2013-11-22T18:26:49Z</dc:date>
    </item>
  </channel>
</rss>

