MTM_RT_INTRP_VW

(SQL View)
Index Back

Interpolated rates for MTM

The following view interpolates rates for a given rate curve ona specific date.

SELECT R1.RT_RATE_INDEX , R1.FROM_CUR , R1.TO_CUR , R1.RT_TYPE , R1.EFFDT , %DateDiff(R2.EFFDT,D.CALENDAR_DATE) , D.CALENDAR_DATE ,%Round(%DecMult(R1.RATE_MULT,R1.RATE_DIV) + %DecDiv( %DecMult( (%DECMULT(R2.RATE_MULT,R2.RATE_DIV) - %DECMULT(R1.RATE_MULT,R1.RATE_DIV) ) , ( R2.TERM- %DATEDIFF(R2.EFFDT,D.CALENDAR_DATE) ) ) , (R2.TERM-R1.TERM) ) ,8) FROM PS_POS_DAYS_TBL D , PS_RT_RATE_TBL R1 , PS_RT_RATE_TBL R2 WHERE R1.TERM = ( SELECT MAX(TERM) FROM PS_RT_RATE_TBL R3 WHERE R3.RT_RATE_INDEX = R1.RT_RATE_INDEX AND R3.RT_TYPE = R1.RT_TYPE AND R3.FROM_CUR = R1.FROM_CUR AND R3.TO_CUR = R1.TO_CUR AND R3.EFFDT = R1.EFFDT AND R3.TERM < %DateDiff( R1.EFFDT, D.CALENDAR_DATE )) AND R2.RT_RATE_INDEX = R1.RT_RATE_INDEX AND R2.EFFDT = R1.EFFDT AND R2.RT_TYPE = R1.RT_TYPE AND R2.FROM_CUR = R1.FROM_CUR AND R2.TO_CUR = R1.TO_CUR AND R2.TERM = ( SELECT MIN(TERM) FROM PS_RT_RATE_TBL R4 WHERE R4.RT_RATE_INDEX = R2.RT_RATE_INDEX AND R4.RT_TYPE = R2.RT_TYPE AND R4.FROM_CUR = R2.FROM_CUR AND R4.TO_CUR = R2.TO_CUR AND R4.EFFDT = R2.EFFDT AND R4.TERM >= %DateDiff(R2.EFFDT, D.CALENDAR_DATE ))

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 RT_RATE_INDEX Character(10) VARCHAR2(10) NOT NULL Market Rate Index
2 FROM_CUR Character(3) VARCHAR2(3) NOT NULL From Currency Code
3 TO_CUR Character(3) VARCHAR2(3) NOT NULL To Currency Code
4 RT_TYPE Character(5) VARCHAR2(5) NOT NULL Defines a category of market rates for currency conversion. Some examples of rate types are commercial, average, floating, and historical.
5 EFFDT Date(10) DATE Effective Date
6 TERM Number(5,0) INTEGER NOT NULL Term
7 CALENDAR_DATE Date(10) DATE An internal work field utilized to store calendar dates for a given calendar year. The dates are displa
8 RT_RATE Number(16,8) DECIMAL(15,8) NOT NULL Market Rate