<?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: Aggr function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443390#M566129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not able to attach qvw file in this post, so I attaced it in first post (QLIK_MAGAZZINI_R.1.1_test.qvw).&lt;/P&gt;&lt;P&gt;Actually the only solution I've found is to concat "dt doc stireria" and "nr doc stireria".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="27257" class="jive-image-thumbnail jive-image" onclick="" alt="CatturaCdT_2012_12_20.JPG" src="https://community.qlik.com/legacyfs/online/27257_CatturaCdT_2012_12_20.JPG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Dec 2012 10:18:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-12-20T10:18:21Z</dc:date>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443386#M566125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt; I have this situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="26943" alt="2012_12_17_magazzini.JPG" class="jive-image-thumbnail jive-image" src="https://community.qlik.com/legacyfs/online/26943_2012_12_17_magazzini.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the same article I have 1 document associated with the customer and for the same document associated with the customer I have 2 or more warehouse documents.&lt;/P&gt;&lt;P&gt;Therefore I have many rows associated with the same customer. And this is correct.&lt;/P&gt;&lt;P&gt;My problem is in the total. As you see in the picture, the field "Ordinato" is a quantity. Sum(Ordinato) is wrong because in this way I have total in all rows.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(distinct Ordinato) returns the values I expect but is not logically correct.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(sum(Ordinato),fornitore,numdoc,linea,cod.articolo,cod.colore,dt doc stireria,nr doc stireria)) doesn't work.&lt;/P&gt;&lt;P&gt;Also &lt;/P&gt;&lt;P&gt;sum(aggr((Ordinato),fornitore,numdoc,linea,cod.articolo,cod.colore,dt doc stireria,nr doc stireria)) has column fields correct but it calculates wrong total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have 860.00 as total and &lt;/P&gt;&lt;P&gt;605.00, &lt;/P&gt;&lt;P&gt;605.00, &lt;/P&gt;&lt;P&gt;605.00, &lt;/P&gt;&lt;P&gt;605.00, &lt;/P&gt;&lt;P&gt;255.00 &lt;/P&gt;&lt;P&gt;in columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 16:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443386#M566125</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-17T16:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443387#M566126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Sum(distinct Ordinato) returns the values I expect but is not logically correct.&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Actually, it is logically correct in this case. It calculates exactly what you're asking for. The sum of the distinct values of Ordinato over all the pivot dimensions you wish to consider in calculating the sum. You already found your solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 16:37:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443387#M566126</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-17T16:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443388#M566127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you but this is not the right solution because I can have different "cod.colore" with the same "ordinato" qty. In this way, doing sum(distinct ordinato) I'll lose a lot of qty.&lt;IMG __jive_id="27235" class="jive-image-thumbnail jive-image" onclick="" alt="CdTMagazzini.JPG" src="https://community.qlik.com/legacyfs/online/27235_CdTMagazzini.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The correct total is 1650, not 1200.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 08:31:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443388#M566127</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-20T08:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443389#M566128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u post new documente with Num.Doc 527?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 09:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443389#M566128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-20T09:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443390#M566129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not able to attach qvw file in this post, so I attaced it in first post (QLIK_MAGAZZINI_R.1.1_test.qvw).&lt;/P&gt;&lt;P&gt;Actually the only solution I've found is to concat "dt doc stireria" and "nr doc stireria".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="27257" class="jive-image-thumbnail jive-image" onclick="" alt="CatturaCdT_2012_12_20.JPG" src="https://community.qlik.com/legacyfs/online/27257_CatturaCdT_2012_12_20.JPG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 10:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443390#M566129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-20T10:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443391#M566130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like this then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Dimensionality()=11,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum(distinct VEN_QTA_ORD),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum(aggr(sum(distinct VEN_QTA_ORD), C_COLORE)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 14:00:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443391#M566130</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-20T14:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443392#M566131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;if(RowNo() &amp;lt;&amp;gt; 0, sum( VEN_QTA_ORD), Sum(DISTINCT VEN_QTA_ORD))&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 14:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443392#M566131</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-12-20T14:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443393#M566132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works!! Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 14:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/443393#M566132</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-20T14:19:30Z</dc:date>
    </item>
  </channel>
</rss>

