<?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 Difference between sum and expression Total in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-between-sum-and-expression-Total/m-p/645495#M1072321</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I use below expression to calculate charges. It has below logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=money((if(OWNER='ABC' or OWNER='XYZ',0,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(if(((OWNER='YYY' or OWNER='ZZZ') and (Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')))&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;,sum(YYY_Total),(if((OWNER='YYY'),sum(YYY_Total),(if((Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((if((sum(COUNTA)&amp;lt;=13000),((sum(COUNTA)*.1)*190.6),if((sum(COUNTA)&amp;gt;13000 and&amp;nbsp; sum(COUNTA)&amp;lt;=22000),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((((sum(COUNTA)-13000)*.083)+1300)*190.6),((((sum(COUNTA)-22000)*.071)+2047)*190.6))))) ,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((if((sum(COUNTA)&amp;lt;=13000),((sum(COUNTA)*.1010)*190.6),if((sum(COUNTA)&amp;gt;13000 and&amp;nbsp; sum(COUNTA)&amp;lt;=22000),((((sum(COUNTA)-13000)*.0838)+1313)*190.6),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((((sum(COUNTA)-22000)*.0715)+2067.2)*190.6))))))))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So I use this in straight Table to get separate values based on OWNER,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So the individual values are correct according to logic, but the Total is incorrect when i select expression total.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Here i use same expression in text object to get total sum of values. So i need to get actual sum of all owners, but now the display value is incorrect. please help me to solve this and get correct Total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 09:38:34 GMT</pubDate>
    <dc:creator>anuradhaa</dc:creator>
    <dc:date>2014-08-08T09:38:34Z</dc:date>
    <item>
      <title>Difference between sum and expression Total</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-sum-and-expression-Total/m-p/645495#M1072321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I use below expression to calculate charges. It has below logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=money((if(OWNER='ABC' or OWNER='XYZ',0,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(if(((OWNER='YYY' or OWNER='ZZZ') and (Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')))&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;,sum(YYY_Total),(if((OWNER='YYY'),sum(YYY_Total),(if((Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((if((sum(COUNTA)&amp;lt;=13000),((sum(COUNTA)*.1)*190.6),if((sum(COUNTA)&amp;gt;13000 and&amp;nbsp; sum(COUNTA)&amp;lt;=22000),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((((sum(COUNTA)-13000)*.083)+1300)*190.6),((((sum(COUNTA)-22000)*.071)+2047)*190.6))))) ,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((if((sum(COUNTA)&amp;lt;=13000),((sum(COUNTA)*.1010)*190.6),if((sum(COUNTA)&amp;gt;13000 and&amp;nbsp; sum(COUNTA)&amp;lt;=22000),((((sum(COUNTA)-13000)*.0838)+1313)*190.6),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;((((sum(COUNTA)-22000)*.0715)+2067.2)*190.6))))))))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So I use this in straight Table to get separate values based on OWNER,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So the individual values are correct according to logic, but the Total is incorrect when i select expression total.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Here i use same expression in text object to get total sum of values. So i need to get actual sum of all owners, but now the display value is incorrect. please help me to solve this and get correct Total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:38:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-sum-and-expression-Total/m-p/645495#M1072321</guid>
      <dc:creator>anuradhaa</dc:creator>
      <dc:date>2014-08-08T09:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between sum and expression Total</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-sum-and-expression-Total/m-p/645496#M1072322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are better off fixing your data model before starting to tackle that beast of an expression. This is neither scalable nor maintainable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the total calculation you have multiple values for OWNER and MonthYear so you can't call them without an aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Surround your whole expression with Sum(Aggr(EXPRESSION,OWNER,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MonthYear&lt;/SPAN&gt;)) and you should get an answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:44:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-sum-and-expression-Total/m-p/645496#M1072322</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2014-08-08T09:44:51Z</dc:date>
    </item>
  </channel>
</rss>

