<?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: bad aggr(sum total pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899802#M313052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matteo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are a few issues with using AGGR() they way you do. For one, you should always include all your chart dimensions in the list of AGGR() dimensions. This may or may not be the specific cause of the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, instead of describing all the problems with AGGR, I'd like you to rather think in terms of Set Analysis. Your goal is to summarize VT for those Key values that have positive sum of QT - correct? The corresponding Set Analysis condition looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;KEY_ITEMYYMM={"=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum([QT])&amp;gt;0&lt;/SPAN&gt;"}&lt;/SPAN&gt;&amp;gt;}&amp;nbsp; VT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Set Analysis condition uses an Advanced Search expression (enclosed in double quotes with an equals sign in the beginning) that only selects those keys that fulfill your condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read more about various uses of Set Analysis and AGGR in my new book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=PEK7EPEMA2O76E2W"&gt;QlikView Your Business&lt;/A&gt; that's coming out very soon. You can also attend my lecture on Advanced Aggregation and Set Analysis at the &lt;A href="http://www.masterssummit.com/"&gt;Masters Summit for QlikView&lt;/A&gt; - coming this September to New York and Copenhagen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2015 16:59:06 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2015-07-17T16:59:06Z</dc:date>
    <item>
      <title>bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899800#M313050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I've an issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My table is like this one below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Type&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;KEY_ITEMYYMM&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Store&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;YYMM&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;QT&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;VT&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A01_1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-500&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A01_1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;888&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;600&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A02_1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A02_1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;888&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1501&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-250&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-250&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a pivot table with this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(aggr(sum([QT]),&amp;nbsp; KEY_ITEMYYMM )&amp;lt;=0, 0, sum(VT))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the sum of the items in the stores is negative I assume there are no items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if I expand all - the expression runs. But if I minimize figures by the first dimension the pivot sum is bad (I want 100 instead of -50).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Type&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; sum(VT)&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2 &lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-500+600+100-250=-50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Type&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;if(aggr(sum([QT]),&amp;nbsp; KEY_ITEMYYMM )&amp;lt;=0, 0, sum(VT))&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-500+600+0+0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 16:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899800#M313050</guid>
      <dc:creator>captain89</dc:creator>
      <dc:date>2015-07-17T16:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899801#M313051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(if(aggr(sum([QT]),&amp;nbsp; KEY_ITEMYYMM )&amp;lt;=0, 0, sum(VT)), KEY_ITEMYYMM, Type))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 16:52:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899801#M313051</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-17T16:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899802#M313052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matteo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are a few issues with using AGGR() they way you do. For one, you should always include all your chart dimensions in the list of AGGR() dimensions. This may or may not be the specific cause of the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, instead of describing all the problems with AGGR, I'd like you to rather think in terms of Set Analysis. Your goal is to summarize VT for those Key values that have positive sum of QT - correct? The corresponding Set Analysis condition looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;KEY_ITEMYYMM={"=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum([QT])&amp;gt;0&lt;/SPAN&gt;"}&lt;/SPAN&gt;&amp;gt;}&amp;nbsp; VT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Set Analysis condition uses an Advanced Search expression (enclosed in double quotes with an equals sign in the beginning) that only selects those keys that fulfill your condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read more about various uses of Set Analysis and AGGR in my new book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=PEK7EPEMA2O76E2W"&gt;QlikView Your Business&lt;/A&gt; that's coming out very soon. You can also attend my lecture on Advanced Aggregation and Set Analysis at the &lt;A href="http://www.masterssummit.com/"&gt;Masters Summit for QlikView&lt;/A&gt; - coming this September to New York and Copenhagen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 16:59:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899802#M313052</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-07-17T16:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899803#M313053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See Attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/93236_Capture1.PNG" style="height: 136px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ho0pe that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 17:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899803#M313053</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2015-07-17T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899804#M313054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would also use the expression suggested by Oleg instead of using aggr for this &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 17:39:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899804#M313054</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-07-17T17:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899805#M313055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. That's what I need!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 07:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899805#M313055</guid>
      <dc:creator>captain89</dc:creator>
      <dc:date>2015-07-20T07:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: bad aggr(sum total pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899806#M313056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please close this thread by marking the correct answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 08:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/bad-aggr-sum-total-pivot-table/m-p/899806#M313056</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-07-20T08:35:11Z</dc:date>
    </item>
  </channel>
</rss>

