<?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: Can data be aggregated within the IRR function? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231120#M24059</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel your pain -- you may have seen my post &lt;A href="https://community.qlik.com/thread/209646"&gt;Order of IRR payments&lt;/A&gt;. I have not obtained correct results with IRR unless the data was loaded in order. Maintaining order is impossible if any amount repeats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last time I checked, the sorting in Aggr() only applies to the data fed to the Aggr expression parameter. It does not make Aggr return sorted results. Disappointing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might try XIRR as a workaround. I've gotten close, but never exactly duplicated IRR results with XIRR. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Feb 2017 23:51:33 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2017-02-20T23:51:33Z</dc:date>
    <item>
      <title>Can data be aggregated within the IRR function?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231119#M24058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to compute IRRs at various grouping layers and wondering if this is possible within Qlik Sense at the chart level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each account in our data contains a month number (-1 to 157) and a cash flow amount.&amp;nbsp; Thus account #1 has 159 rows (MthNums -1 to 157), account #2 has 159 rows, and so on.&amp;nbsp; I want to aggregate the cash flow amounts up to various dimensions like state, or type of account, or just a grand total across all dimensions where all accounts are summed up together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the following formula for the grand total IRR:&lt;/P&gt;&lt;P&gt; IRR(aggr(sum(CashFlow), MthNum))&lt;/P&gt;&lt;P&gt;with no result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I read about sort order and tried the following:&lt;/P&gt;&lt;P&gt; IRR(aggr(sum(CashFlow), (MthNum,(NUMERIC,ASCENDING)))).&lt;/P&gt;&lt;P&gt;In my mind, the aggr function should produce a temporary table of CashFlow numbers that are totalled for each MthNum&amp;nbsp; -- thus the exact array of values that would be needed to compute an IRR.&amp;nbsp; In fact I have created a temporary chart with MthNum and sum(CashFlow), downloaded the values into excel and run an IRR function across the cash flow numbers with a valid answer.&amp;nbsp; However, in Qlik Sense, this also returns no result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had read in the forum that there might have been some issues with the IRR function, but I thought that sorting in the aggr function was supposed to solve the issues.&amp;nbsp; The help document talks about using aggr within the IRR function, but doesn't give any examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone offer some assistance?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2017 22:54:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231119#M24058</guid>
      <dc:creator />
      <dc:date>2017-02-20T22:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can data be aggregated within the IRR function?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231120#M24059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel your pain -- you may have seen my post &lt;A href="https://community.qlik.com/thread/209646"&gt;Order of IRR payments&lt;/A&gt;. I have not obtained correct results with IRR unless the data was loaded in order. Maintaining order is impossible if any amount repeats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last time I checked, the sorting in Aggr() only applies to the data fed to the Aggr expression parameter. It does not make Aggr return sorted results. Disappointing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might try XIRR as a workaround. I've gotten close, but never exactly duplicated IRR results with XIRR. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2017 23:51:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231120#M24059</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-02-20T23:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can data be aggregated within the IRR function?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231121#M24060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for responding to my post.&amp;nbsp; Yes, I did read your post, and I reread it again to get some additional information.&amp;nbsp; I did manage to get the XIRR function to work on the total of all accounts.&amp;nbsp; The formula I used was:&lt;/P&gt;&lt;P&gt;&amp;nbsp; xirr(aggr(sum(CashFlow), MthNum), MakeDate(2017,2,1) + (MthNum*365.25/12))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gets me pretty close to the IRR computation (it will change depending on the start date; the above formula uses 2/1/17 as the start date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried using the following formula to compute an IRR by state:&lt;/P&gt;&lt;P&gt;&amp;nbsp; xirr(aggr(sum(CashFlow), State, MthNum), MakeDate(2017,2,1) + (MthNum*365.25/12))&lt;/P&gt;&lt;P&gt;I would assume that this would summarize the cash flows by state and month, and then compute an IRR for each state.&amp;nbsp; I then tried creating a simple table with state and this measure (the XIRR formula).&amp;nbsp; I get a spinning wheel in the chart for several minutes, and then a "Calculation timed out" error.&amp;nbsp; I am working with a reasonably large data set (just over 1 million records) and am working on a desktop (new machine with an i7 processor and 32 Gb of ram).&amp;nbsp; So either my XIRR formula is done incorrectly, or Qlik Sense is just not the best tool to handle this kind of computation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am going to mark this post as "Answered", as I think your response has taken me as far as I can get, but if you do have any other ideas that you think might be worth trying, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for responding!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2017 14:24:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231121#M24060</guid>
      <dc:creator />
      <dc:date>2017-02-22T14:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can data be aggregated within the IRR function?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231122#M24061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry,&amp;nbsp; I wasn't able to figure out how to mark this as answered, so I marked it Helpful instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2017 14:32:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-data-be-aggregated-within-the-IRR-function/m-p/1231122#M24061</guid>
      <dc:creator />
      <dc:date>2017-02-22T14:32:33Z</dc:date>
    </item>
  </channel>
</rss>

