I have a below script from which I want to calculate DefaultRate. The formula to do it is, I need to check if any LoanKey made 3 consecutive payments and then a default I need to calculate it. How can I acheive it with below tables? I have LoanKey and then Reporting Date Key and Amount as seen below. I need to look for customers who havent paid anytime after 3 consecutive payment months.
vLastFctPayment:
LOAD
PaymentID,
PortfolioKey,
YearMonth,
PaymentSequence,
LoanKey,
AddressKey,
PersonKey,
PaymentPlanKey,
TransactionTypeKey,
TransactionDateKey as ReportingDateKey,
TransactionDateKey as PaymentTransactionDateKey,
PostedDateKey,
ClearedDateKey,
Amount ;
SQL SELECT *
FROM "Table
where Portfoliokey=$(vPortfoliokey);
Thanks a ton in advance and any suggestion is welcome.