Hello,
The script below creates a table that has Principal and Interest payment information for a 30 year loan with monthly payments. You can adjust the initial Principal and Interest Rate in the table variables. I also included columns for cumulative principal and interest payments as well as the remaining balance. I'm not sure if this is what you were looking for, but I hope it helps you get there.
Michael
New Table( "Loan Payments",
Add Rows( 360 ),
New Table Variable( "Principal", 100000 ),
New Table Variable( "Interest Rate", 0.04 ),
New Column( "Month", Numeric, "Continuous", Format( "Best", 12 ), Set Values( 1 :: 360 ) ),
New Column( "Principal Payment",
Numeric,
"Continuous",
Format( "Currency", "USD", 17, 2 ),
Formula( Principal Payment( :Interest Rate / 12, :Month, 360, -:Principal ) )
),
New Column( "Interest Payment",
Numeric,
"Continuous",
Format( "Currency", "USD", 17, 2 ),
Formula( Interest Payment( :Interest Rate / 12, :Month, 360, -:Principal ) )
),
New Column( "Total Payment",
Numeric,
"Continuous",
Format( "Currency", "USD", 17, 2 ),
Formula( Payment( :Interest Rate / 12, 360, -:Principal ) )
),
New Column( "Cumulative Principal",
Numeric,
"Continuous",
Format( "Currency", "USD", 17, 2 ),
Formula( Col Cumulative Sum( :Principal Payment ) )
),
New Column( "Cumulative Interest",
Numeric,
"Continuous",
Format( "Currency", "USD", 17, 2 ),
Formula( Col Cumulative Sum( :Interest Payment ) )
),
New Column( "Remaining Balance",
Numeric,
"Continuous",
Format( "Currency", "USD", 17, 2 ),
Formula( :Principal - :Cumulative Principal )
)
)
... View more