<?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 Aggr in Pivot Table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggr-in-Pivot-Table/m-p/1539815#M38973</link>
    <description>&lt;P&gt;Hi, starting from a&amp;nbsp;data base of sales&amp;nbsp;I&amp;nbsp;have to&amp;nbsp;attribute among the various costs also those of the 3 agents (B, M, R), in practice:&lt;BR /&gt;a. I take the total CostoAM (external variable) and multiply it by% CPersAM (the weight of the single agent on the total of their 3 costs)&lt;BR /&gt;b. I distribute it on the basis of the turnover made by each single agent (I want every line of sale to have its cost so as to make any possible processing)&lt;/P&gt;&lt;P&gt;&lt;U&gt;The formula of the measure AREA Mng is:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;AreaM2={"M"}&amp;gt;}Qty*ASP)/sum(total{$&amp;lt;AreaM2={"M"}&amp;gt;}(Qty*ASP))*$(CostoAM)*[%CPersAM]+&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;AreaM2={"R"}&amp;gt;}Qty*ASP)/sum(total{$&amp;lt;AreaM2={"R"}&amp;gt;}(Qty*ASP))*$(CostoAM)*[%CPersAM]+&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;AreaM2={"B"}&amp;gt;}Qty*ASP)/sum(total{$&amp;lt;AreaM2={"B"}&amp;gt;}(Qty*ASP))*$(CostoAM)*[%CPersAM]&lt;/P&gt;&lt;P&gt;In photo 1) it runs but&amp;nbsp;when I lower the field AREA M to a level below the function sum only where there are unique values ​​(only on&amp;nbsp;EXPORT there is only one agent), in fact it asks me for an aggregation but if I add an&amp;nbsp;AGGR/SUM&amp;nbsp;function&amp;nbsp;on the whole formula&amp;nbsp;don't runs&amp;nbsp;... I have tried in various other ways.&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine.png" style="width: 255px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5237iC70C49E005F5830F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine.png" alt="Immagine.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine2.png" style="width: 225px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5238iFC7DAFDF9658CE49/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine2.png" alt="Immagine2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Feb 2019 17:19:31 GMT</pubDate>
    <dc:creator>luciozanarotto</dc:creator>
    <dc:date>2019-02-05T17:19:31Z</dc:date>
    <item>
      <title>Aggr in Pivot Table</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-in-Pivot-Table/m-p/1539815#M38973</link>
      <description>&lt;P&gt;Hi, starting from a&amp;nbsp;data base of sales&amp;nbsp;I&amp;nbsp;have to&amp;nbsp;attribute among the various costs also those of the 3 agents (B, M, R), in practice:&lt;BR /&gt;a. I take the total CostoAM (external variable) and multiply it by% CPersAM (the weight of the single agent on the total of their 3 costs)&lt;BR /&gt;b. I distribute it on the basis of the turnover made by each single agent (I want every line of sale to have its cost so as to make any possible processing)&lt;/P&gt;&lt;P&gt;&lt;U&gt;The formula of the measure AREA Mng is:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;AreaM2={"M"}&amp;gt;}Qty*ASP)/sum(total{$&amp;lt;AreaM2={"M"}&amp;gt;}(Qty*ASP))*$(CostoAM)*[%CPersAM]+&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;AreaM2={"R"}&amp;gt;}Qty*ASP)/sum(total{$&amp;lt;AreaM2={"R"}&amp;gt;}(Qty*ASP))*$(CostoAM)*[%CPersAM]+&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;AreaM2={"B"}&amp;gt;}Qty*ASP)/sum(total{$&amp;lt;AreaM2={"B"}&amp;gt;}(Qty*ASP))*$(CostoAM)*[%CPersAM]&lt;/P&gt;&lt;P&gt;In photo 1) it runs but&amp;nbsp;when I lower the field AREA M to a level below the function sum only where there are unique values ​​(only on&amp;nbsp;EXPORT there is only one agent), in fact it asks me for an aggregation but if I add an&amp;nbsp;AGGR/SUM&amp;nbsp;function&amp;nbsp;on the whole formula&amp;nbsp;don't runs&amp;nbsp;... I have tried in various other ways.&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine.png" style="width: 255px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5237iC70C49E005F5830F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine.png" alt="Immagine.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine2.png" style="width: 225px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5238iFC7DAFDF9658CE49/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine2.png" alt="Immagine2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 17:19:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-in-Pivot-Table/m-p/1539815#M38973</guid>
      <dc:creator>luciozanarotto</dc:creator>
      <dc:date>2019-02-05T17:19:31Z</dc:date>
    </item>
  </channel>
</rss>

