<?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 Chart Aggr question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656870#M239845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am having some problem with the Aggr formula in a chart, my scenario is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a table with two dimensions; Company and Object and one expression which is the amount, now the amount can be positive or negative.&lt;/P&gt;&lt;P&gt;what i am trying to do is to add 2 expressions; the first one giving the sum of the positive amount and the second one showing the sum of the negative amount while displaying only the company as a dimension, that is why i need to aggr on the level of company, object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to note that the amount is calculated from a variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//get first the previous years&lt;/P&gt;&lt;P&gt;(Sum({&amp;lt;[Transaction Year]=,[Transaction Month Name]=,[Period Number]=,[Fiscal Year]=,[Transaction Year]={"&amp;lt;$(=max([Transaction Year]))"}, [Act Group]={'CashBank'},[Object Account]=, [Object Account]={1211,1212}&amp;gt;}[Ammount USD])&lt;/P&gt;&lt;P&gt;//now until selected year and month&lt;/P&gt;&lt;P&gt;+Sum({&amp;lt;[Transaction Year]={$(=max([Transaction Year]))},[Transaction Month Name]=,[Period Number]={"&amp;lt;=$(=MAX([Period Number]))"}, [Act Group]={'CashBank'},[Object Account]=, [Object Account]={1211,1212}&amp;gt;}[Ammount USD]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else i would have just add sum({&amp;lt;Amount={'&amp;gt;=0'}&amp;gt;}Amount) as&amp;nbsp; the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so suppose i have the below table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 155px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="56"&gt;Company&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="41"&gt;Object&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="58"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;&lt;P&gt;123&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result will be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 192px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="64"&gt;Company&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Positive&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="64"&gt;Negatvie&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;213&lt;/TD&gt;&lt;TD align="right"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2014 07:55:16 GMT</pubDate>
    <dc:creator>maleksafa</dc:creator>
    <dc:date>2014-06-11T07:55:16Z</dc:date>
    <item>
      <title>Chart Aggr question</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656870#M239845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am having some problem with the Aggr formula in a chart, my scenario is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a table with two dimensions; Company and Object and one expression which is the amount, now the amount can be positive or negative.&lt;/P&gt;&lt;P&gt;what i am trying to do is to add 2 expressions; the first one giving the sum of the positive amount and the second one showing the sum of the negative amount while displaying only the company as a dimension, that is why i need to aggr on the level of company, object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to note that the amount is calculated from a variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//get first the previous years&lt;/P&gt;&lt;P&gt;(Sum({&amp;lt;[Transaction Year]=,[Transaction Month Name]=,[Period Number]=,[Fiscal Year]=,[Transaction Year]={"&amp;lt;$(=max([Transaction Year]))"}, [Act Group]={'CashBank'},[Object Account]=, [Object Account]={1211,1212}&amp;gt;}[Ammount USD])&lt;/P&gt;&lt;P&gt;//now until selected year and month&lt;/P&gt;&lt;P&gt;+Sum({&amp;lt;[Transaction Year]={$(=max([Transaction Year]))},[Transaction Month Name]=,[Period Number]={"&amp;lt;=$(=MAX([Period Number]))"}, [Act Group]={'CashBank'},[Object Account]=, [Object Account]={1211,1212}&amp;gt;}[Ammount USD]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else i would have just add sum({&amp;lt;Amount={'&amp;gt;=0'}&amp;gt;}Amount) as&amp;nbsp; the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so suppose i have the below table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 155px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="56"&gt;Company&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="41"&gt;Object&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="58"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;&lt;P&gt;123&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result will be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 192px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="64"&gt;Company&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Positive&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="64"&gt;Negatvie&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;213&lt;/TD&gt;&lt;TD align="right"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 07:55:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656870#M239845</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-06-11T07:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Aggr question</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656871#M239846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not very sure about your doubt. Do you mean that having issues to include '&amp;lt;Amount={'&amp;gt;=0'}&amp;gt;}' of set analysis into the existing expression? Otherwise, it looks fine for positive figures.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 08:17:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656871#M239846</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-06-11T08:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Aggr question</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656872#M239847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you take the below example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 155px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="56"&gt;Company&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="41"&gt;Object&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="58"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for Company C1, Object O2 you have -10 and 123 so the sum will be 113 + 100 from C1,O1 under positive amount, so it is the sum of the amount by object, company. and not the sum of the positive or negative amount only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as if you are doing the below (step by step):&lt;/P&gt;&lt;P&gt;first calculate the sum of amount by Company, Object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="64"&gt;Company&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Object&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;113&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;O2&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17"&gt;C2&lt;/TD&gt;&lt;TD class="xl68" style="border-left: none;"&gt;O1&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-left: none;"&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you will get for each company, the sum of positive amount and sum of negative amount and you will end up with the below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="64"&gt;Company&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Positive&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="64"&gt;Negatvie&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;213&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD align="right"&gt;-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 08:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Aggr-question/m-p/656872#M239847</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-06-11T08:42:20Z</dc:date>
    </item>
  </channel>
</rss>

