<?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 gives unexpected results in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggr-Function-gives-unexpected-results/m-p/1035058#M16028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Perhaps this works: Exp(Sum(Log(Aggr(&lt;STRONG&gt;NODISTINCT&lt;/STRONG&gt; Sum(SecReturn), Date)+1)))-1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Jan 2016 18:13:53 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2016-01-24T18:13:53Z</dc:date>
    <item>
      <title>Aggr Function gives unexpected results</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-Function-gives-unexpected-results/m-p/1035057#M16027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm struggling with the Aggr function. What I'm trying to achieve is the following which relates to returns on securities. I have a range of securities each with monthly returns, so my fields are Date, Security and SecReturn. To aggregate returns I need to arithmetically sum returns across securities for each month and then geometrically sum those returns across multiple months. I've created a Master Measure called Contribution which equals Exp(Sum(Log(Aggr(Sum(SecReturn), Date)+1)))-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine when looking at the overall result (i.e. all securities), but when looking at it in a chart where security is a dimension it doesn't work as it seems to randomly apply the monthly return to one security each month. I need it to work for both. Note, I don't want to create two dimensions since I have groups of securities and this function needs to work across those groups too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 10:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-Function-gives-unexpected-results/m-p/1035057#M16027</guid>
      <dc:creator />
      <dc:date>2016-01-20T10:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr Function gives unexpected results</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-Function-gives-unexpected-results/m-p/1035058#M16028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Perhaps this works: Exp(Sum(Log(Aggr(&lt;STRONG&gt;NODISTINCT&lt;/STRONG&gt; Sum(SecReturn), Date)+1)))-1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jan 2016 18:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-Function-gives-unexpected-results/m-p/1035058#M16028</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-01-24T18:13:53Z</dc:date>
    </item>
  </channel>
</rss>

