<?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: Accrual Percent (Investment Income) Calculation - Excel equivalent to Product() or Rollup values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2480403#M100701</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/153205"&gt;@EddieG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can calculate the cumulative product using a FOR loop within the load script.&lt;/P&gt;
&lt;P&gt;First load data sorted by month to correctly calculate the cumulative product, then:&lt;/P&gt;
&lt;P&gt;DataWithAccrual:&lt;BR /&gt;LOAD&lt;BR /&gt;Month,&lt;BR /&gt;Percent,&lt;BR /&gt;1 AS AccrualPercent // Initialize with 1&lt;BR /&gt;RESIDENT Data //Your data source table&lt;BR /&gt;ORDER BY Month;&lt;/P&gt;
&lt;P&gt;LET vAccrualPercent = 1;&lt;/P&gt;
&lt;P&gt;FOR i = 1 TO NoOfRows('DataWithAccrual')&lt;BR /&gt;LET vPercent = Peek('Percent', i - 1, 'DataWithAccrual');&lt;BR /&gt;LET vAccrualPercent = $(vAccrualPercent) * $(vPercent);&lt;BR /&gt;UPDATE DataWithAccrual SET AccrualPercent = $(vAccrualPercent) WHERE RecNo() = $(i);&lt;BR /&gt;NEXT i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this help&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2024 10:10:07 GMT</pubDate>
    <dc:creator>F_B</dc:creator>
    <dc:date>2024-09-09T10:10:07Z</dc:date>
    <item>
      <title>Accrual Percent (Investment Income) Calculation - Excel equivalent to Product() or Rollup values</title>
      <link>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2164628#M94594</link>
      <description>&lt;P&gt;Good evening,&lt;/P&gt;
&lt;P&gt;I'm hoping for some help with a calculation in the load script. I typically find most answers here on the forums or&amp;nbsp; figure it out on my own, but this one is stumping me. I might just be missing something simple.&lt;/P&gt;
&lt;P&gt;I need to do what I'm being told is an investment income calculation. Part of the calculation involves multiplying the current month's percent times the previous month's accrued percent:&lt;/P&gt;
&lt;TABLE width="370"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="88"&gt;Excel Column/Row&lt;/TD&gt;
&lt;TD width="75"&gt;A&lt;/TD&gt;
&lt;TD width="103"&gt;&amp;nbsp;B&amp;nbsp;&lt;/TD&gt;
&lt;TD width="104"&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;Month&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;Percent&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Accrual Percent&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;1/31/2023&lt;/TD&gt;
&lt;TD&gt;100.4024%&lt;/TD&gt;
&lt;TD&gt;103.0595%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;2/28/2023&lt;/TD&gt;
&lt;TD&gt;100.4287%&lt;/TD&gt;
&lt;TD&gt;102.6465%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;3/31/2023&lt;/TD&gt;
&lt;TD&gt;100.4073%&lt;/TD&gt;
&lt;TD&gt;102.2083%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;4/30/2023&lt;/TD&gt;
&lt;TD&gt;100.4188%&lt;/TD&gt;
&lt;TD&gt;101.7938%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;5/31/2023&lt;/TD&gt;
&lt;TD&gt;100.4528%&lt;/TD&gt;
&lt;TD&gt;101.3693%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;6/30/2023&lt;/TD&gt;
&lt;TD&gt;100.4541%&lt;/TD&gt;
&lt;TD&gt;100.9124%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;7/31/2023&lt;/TD&gt;
&lt;TD&gt;100.4563%&lt;/TD&gt;
&lt;TD&gt;100.4563%&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;June is&amp;nbsp;100.4541% *&amp;nbsp;100.4563% OR PRODUCT(B7:B8)&lt;/P&gt;
&lt;P&gt;May is&amp;nbsp;100.4528% *&amp;nbsp;&amp;nbsp;100.9124% OR PRODUCT(B6:B8)&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Jan is&amp;nbsp;100.4024% *&amp;nbsp;102.6465% or PRODUCT(B2:B8)&lt;/P&gt;
&lt;P&gt;I need to calculate the&amp;nbsp;Accrual Percent and I'd like to do it in the load script. I'm thinking I could do some loops and get it done that way, but that seems too messy. Hoping for a more elegant solution.&lt;/P&gt;
&lt;P&gt;With that said, I just realized that I could just do the Accrual Percent in excel (it's just one value per month, changing each month) and load that into Qlik for the rest of the calculations... but now I'm wondering if this could be done in-house.&lt;/P&gt;
&lt;P&gt;Thank you for your time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 23:15:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2164628#M94594</guid>
      <dc:creator>EddieG</dc:creator>
      <dc:date>2024-01-23T23:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Accrual Percent (Investment Income) Calculation - Excel equivalent to Product() or Rollup values</title>
      <link>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2480403#M100701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/153205"&gt;@EddieG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can calculate the cumulative product using a FOR loop within the load script.&lt;/P&gt;
&lt;P&gt;First load data sorted by month to correctly calculate the cumulative product, then:&lt;/P&gt;
&lt;P&gt;DataWithAccrual:&lt;BR /&gt;LOAD&lt;BR /&gt;Month,&lt;BR /&gt;Percent,&lt;BR /&gt;1 AS AccrualPercent // Initialize with 1&lt;BR /&gt;RESIDENT Data //Your data source table&lt;BR /&gt;ORDER BY Month;&lt;/P&gt;
&lt;P&gt;LET vAccrualPercent = 1;&lt;/P&gt;
&lt;P&gt;FOR i = 1 TO NoOfRows('DataWithAccrual')&lt;BR /&gt;LET vPercent = Peek('Percent', i - 1, 'DataWithAccrual');&lt;BR /&gt;LET vAccrualPercent = $(vAccrualPercent) * $(vPercent);&lt;BR /&gt;UPDATE DataWithAccrual SET AccrualPercent = $(vAccrualPercent) WHERE RecNo() = $(i);&lt;BR /&gt;NEXT i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this help&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 10:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2480403#M100701</guid>
      <dc:creator>F_B</dc:creator>
      <dc:date>2024-09-09T10:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Accrual Percent (Investment Income) Calculation - Excel equivalent to Product() or Rollup values</title>
      <link>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2480423#M100708</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/153205"&gt;@EddieG&lt;/a&gt;&amp;nbsp; Assuming your percentage values are stored in numbers format if not you need to convert it to number format&lt;/P&gt;
&lt;P&gt;Data:&lt;BR /&gt;Load Month,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Percent&lt;BR /&gt;FROM Table;&lt;/P&gt;
&lt;P&gt;New:&lt;BR /&gt;Load *,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num(if(RowNo()=1,Percent, Peek(&lt;FONT color="#339966"&gt;&lt;STRONG&gt;AccrualPercent&lt;/STRONG&gt;&lt;/FONT&gt;)*Percent),'#0.0000%') as &lt;FONT color="#339966"&gt;&lt;STRONG&gt;AccrualPercent&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;Resident Data&lt;BR /&gt;&lt;STRONG&gt;Order by Month desc;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Data;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 11:00:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Accrual-Percent-Investment-Income-Calculation-Excel-equivalent/m-p/2480423#M100708</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-09-09T11:00:17Z</dc:date>
    </item>
  </channel>
</rss>

