Hi, need your help urgently.
Working on a Client Portfolio db. Disbursed amounts & Repayments are found on two different views. Am trying to consolidate disbursed amounts within a specific date range. Please help!!! Not sure how to get around this issue. I’m hopeful i’ll find help here!
This code does the job if the value passed exists in the view, but does not calculate within a given range.
EndDate:=oirAsOnDate;
SearchCode:=oirLocation+“/”+oirMonth;
space:= " ";
month:=@Select(@Month(EndDate);“Jan”;“Feb”;“Mar”;“Apr”;“May”; “Jun”;“Jul”;“Aug”;“Sep”;“Oct”;“Nov”;“Dec”);
month2:=@Month(EndDate);
day:=@Text(@Day(EndDate));
year:=@Text(@Year(EndDate));
Odate:= day + space + month + space + year;
SearchTillDate:=@TextToTime(Odate);
getDatesLkup:= @DbLookup(“”:“NoCache”;“”:“”;“modLoanDisbursementLocation-wise”;oirLocation;4;[FailSilent]);
AmtDisb:=@Sum(@DbLookup(“”:“NoCache”;“”:“”;“modLoanDisbursementMonth-wise2”; SearchCode;6;[FailSilent]));
AmtRepaid:=@DbLookup(“”:“NoCache”;“”:“”;“modLoanRepaymentOSBalance”;oirLocation;5;[FailSilent]);
getDatesRepaid:=@DbLookup(“”:“NoCache”;“”:“”;“modLoanRepaymentOSBalance”;oirLocation;9;[FailSilent]);
dateList:=@If(oirLocation=“”;“”;getDatesRepaid);
AmtAOD := 0;
@For(n := 1; n <= @Elements(dateList); n := n + 1;
@If(dateList[n] < SearchTillDate | dateList[n] = SearchTillDate;
AmtAOD:=@If(oirMonth=“”;0; @Sum(AmtRepaid));0));
osBal:=@Abs(AmtDisb-AmtAOD);
@If(oirMonth=“”;0; osBal);