<?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 Calculate interest in a variable period in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calculate-interest-in-a-variable-period/m-p/1827763#M68150</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need some help. I have a document with sales and payments. Between to dates I have calculated the days and the cumulated balance (Sales minus payment)&lt;/P&gt;&lt;P&gt;For cumulated balance I have used the previous and peek function in the script:&lt;/P&gt;&lt;P&gt;if(KUNNR = previous(KUNNR), peek(SaldoWRBTR) - Sum_SaldoWRBTR, Sum_SaldoWRBTR)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as SaldoWRBTR, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* BalanceAmount WRBTR in EURO */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same I did for calculated days:&lt;/P&gt;&lt;P&gt;if(Previous(KUNNR)= KUNNR, Peek(NumBUDAT) - NumBUDAT, num(date(Today())) - NumBUDAT) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as CalculatedDays&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the interest calculation I use an expression in my script :&lt;/P&gt;&lt;P&gt;= if(sum(SaldoWRBTR)&amp;gt; 0, sum(SaldoWRBTR) * (CalculatedDays/365) * (&lt;STRONG&gt;&lt;EM&gt;$(vPercent)&lt;/EM&gt;&lt;/STRONG&gt;/100), 0)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Interest is only calculated when my cumulated balance is greater null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to calculated the Interest amount in a month or in a specific period (f.e. from 05/02/2019 till 05/05/2019&lt;/P&gt;&lt;P&gt;Because the number of sales and payments is every time different, &amp;nbsp;I cannot use simple filters like month.&lt;/P&gt;&lt;P&gt;I have tried the expressions:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Date ={"&amp;gt;=$(=vStartDate) &amp;lt;=$(=vEndDate)"},Month=,Year=&amp;gt;} SaldoWRBTR)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Date ={"&amp;gt;=$(=vStartDate) &amp;lt;=$(=vEndDate)"},Month=,Year=&amp;gt;} (SaldoWRBTR * (CalculatedDays/365) * (&lt;STRONG&gt;&lt;EM&gt;$(vPercent)&lt;/EM&gt;&lt;/STRONG&gt;/100) )&lt;/P&gt;&lt;P&gt;I have added an example in a excel sheet&lt;/P&gt;&lt;P&gt;But those don’t work. I hope someone can help me, thanks in regards Court&lt;/P&gt;</description>
    <pubDate>Tue, 10 Aug 2021 14:40:33 GMT</pubDate>
    <dc:creator>pacoli2013</dc:creator>
    <dc:date>2021-08-10T14:40:33Z</dc:date>
    <item>
      <title>Calculate interest in a variable period</title>
      <link>https://community.qlik.com/t5/App-Development/Calculate-interest-in-a-variable-period/m-p/1827763#M68150</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need some help. I have a document with sales and payments. Between to dates I have calculated the days and the cumulated balance (Sales minus payment)&lt;/P&gt;&lt;P&gt;For cumulated balance I have used the previous and peek function in the script:&lt;/P&gt;&lt;P&gt;if(KUNNR = previous(KUNNR), peek(SaldoWRBTR) - Sum_SaldoWRBTR, Sum_SaldoWRBTR)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as SaldoWRBTR, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* BalanceAmount WRBTR in EURO */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same I did for calculated days:&lt;/P&gt;&lt;P&gt;if(Previous(KUNNR)= KUNNR, Peek(NumBUDAT) - NumBUDAT, num(date(Today())) - NumBUDAT) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as CalculatedDays&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the interest calculation I use an expression in my script :&lt;/P&gt;&lt;P&gt;= if(sum(SaldoWRBTR)&amp;gt; 0, sum(SaldoWRBTR) * (CalculatedDays/365) * (&lt;STRONG&gt;&lt;EM&gt;$(vPercent)&lt;/EM&gt;&lt;/STRONG&gt;/100), 0)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Interest is only calculated when my cumulated balance is greater null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to calculated the Interest amount in a month or in a specific period (f.e. from 05/02/2019 till 05/05/2019&lt;/P&gt;&lt;P&gt;Because the number of sales and payments is every time different, &amp;nbsp;I cannot use simple filters like month.&lt;/P&gt;&lt;P&gt;I have tried the expressions:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Date ={"&amp;gt;=$(=vStartDate) &amp;lt;=$(=vEndDate)"},Month=,Year=&amp;gt;} SaldoWRBTR)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Date ={"&amp;gt;=$(=vStartDate) &amp;lt;=$(=vEndDate)"},Month=,Year=&amp;gt;} (SaldoWRBTR * (CalculatedDays/365) * (&lt;STRONG&gt;&lt;EM&gt;$(vPercent)&lt;/EM&gt;&lt;/STRONG&gt;/100) )&lt;/P&gt;&lt;P&gt;I have added an example in a excel sheet&lt;/P&gt;&lt;P&gt;But those don’t work. I hope someone can help me, thanks in regards Court&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 14:40:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculate-interest-in-a-variable-period/m-p/1827763#M68150</guid>
      <dc:creator>pacoli2013</dc:creator>
      <dc:date>2021-08-10T14:40:33Z</dc:date>
    </item>
  </channel>
</rss>

