Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all!
I am trying to calculate balance_eop using Peek function but seems like it not fully working the way as I want.
here is out I got in the end
and the way I am calculating is
if(%Key_LoanNumber=Peek(%Key_LoanNumber),Peek(Balance_eop)-(pmt((AnnualInterestRate_EOP/12),Duration_EOP,-Peek(balance_eop))-(Peek(balance_eop)*(AnnualInterestRate_EOP/12))),Balance_BOP) as balance_eop
what is your expected result?
HI Marco!
the expected result is when period is not 1 then it take balance from previous row and calculate balance based on the formula given in the script. basically it is loan amortization calculation.
I hope it helps.
Thanks in advance!
There are some important aspects by using peek():
By new created fields you must use peek() but by others you may switch to previous(). Further I suggest to divide your calculation in smaller tasks to see which one work and which not.
- Marcus