<?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: Trouble with the TOTAL function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Trouble-with-the-TOTAL-function/m-p/1657712#M49225</link>
    <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;Try this and let me know if it works&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Total &amp;lt;TransactionType&amp;gt; Amount)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Total &amp;lt;TransactionType&amp;gt; Amount))&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or may be&amp;nbsp; (I'm thinking you need group by any particular field)&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;((Sum(Total &amp;lt;Groupbytype(ex:Month)&amp;gt; Amount)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum(Total &amp;lt;Groupbytype(ex:Month)&amp;gt; Amount))&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2019 21:05:23 GMT</pubDate>
    <dc:creator>bharathadde</dc:creator>
    <dc:date>2019-12-13T21:05:23Z</dc:date>
    <item>
      <title>Trouble with the TOTAL function</title>
      <link>https://community.qlik.com/t5/App-Development/Trouble-with-the-TOTAL-function/m-p/1657336#M49197</link>
      <description>&lt;P&gt;I am building a pivot table where the measure (NetAmount for example) is of the type:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;= (Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I also need another measure (lets call it NetAmount(%)&amp;nbsp;) which represents the part of each row to the total.&lt;/P&gt;&lt;P&gt;If the measure was as simple as &lt;EM&gt;Sum(Amount)&lt;/EM&gt; then the % would be calculated as:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sum(Amount)&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;/ Sum(Total Amount)&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;However in this case&amp;nbsp; the Sum part is not so simple and&amp;nbsp; I am having trouble with the TOTAL part:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The following versions didn't give me the correct results:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;a)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;((Sum(Total{&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum(Total{&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;b)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;BR /&gt;/&lt;BR /&gt;Sum&lt;/EM&gt;&lt;EM&gt;(Total(&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;BR /&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))))&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Any suggestions as to how I can achieve the desired result?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:27:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trouble-with-the-TOTAL-function/m-p/1657336#M49197</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2024-11-16T19:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with the TOTAL function</title>
      <link>https://community.qlik.com/t5/App-Development/Trouble-with-the-TOTAL-function/m-p/1657712#M49225</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;Try this and let me know if it works&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Total &amp;lt;TransactionType&amp;gt; Amount)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Total &amp;lt;TransactionType&amp;gt; Amount))&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or may be&amp;nbsp; (I'm thinking you need group by any particular field)&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;((Sum({&amp;lt;[TransactionType] = {'I'}&amp;gt;} Amount)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum({&amp;lt;[TransactionType] = {'C'}&amp;gt;} Amount))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;((Sum(Total &amp;lt;Groupbytype(ex:Month)&amp;gt; Amount)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;-&amp;nbsp;(Sum(Total &amp;lt;Groupbytype(ex:Month)&amp;gt; Amount))&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 21:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trouble-with-the-TOTAL-function/m-p/1657712#M49225</guid>
      <dc:creator>bharathadde</dc:creator>
      <dc:date>2019-12-13T21:05:23Z</dc:date>
    </item>
  </channel>
</rss>

