Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

Home


XLeratorDB/financial

Use XLeratorDB/financial for a wide variety of financial calculations. The feature-rich XLeratorDB function library lets you include calculations in any T-SQL statement including SELECT, INSERT, UPDATE, DELETE, CREATE VIEW as well as in CTEs, stored procedures, user-defined functions, and computed columns.

XLeratorDB/financial is available in two packages - XLeratorDB/financial which requires SQL Server 2005 or later, and XLeratorDB/financial 2008 which requires SQL Server 2008 or later. 

Functions denoted with 'Not available for SQL2005' are only available in the XLeratorDB/financial 2008 package and will not install or run  in SQL Server 2005. XLeratorDB 2008 packages contain functions which leverage SQL CLR features that are only available in SQL Server 2008 or later, namely 'multi-input aggregates' which provide a much easier calling syntax and typically run much faster than their scalar counterparts.

FUNCTION REFERENCE - FINANCIAL FUNCTIONS
RATES OF RETURN
AMORTIZECASHFLOWS Generate a schedule of discounted cash flow values   (table-valued function)
CUMODDFIPMT    new! Cumulative interest on the periodic annuity payments between a start period and an end period
CUMODDFPPMT    new! Cumulative principal on the periodic annuity payments between a start period and an end period
EFV Enhanced Future Value
EMDIETZ Enhanced Modified Dietz    Not available for SQL2005
ENPV Enhanced Net Present Value
ENPV_q Enhanced Net Present Value  
EPV Enhanced Present Value
FV Future Value
FVGA Future Value of a Growing Annuity
FVSCHEDULE Future Value based on Compound Rates
GTWRR Generalized time-weighted rate of return    Not available for SQL2005
IRR Internal Rate of Return
IRR_q Internal Rate of Return  
LMDIETZ Linked Modified Dietz    Not available for SQL2005
MDIETZ Modified Dietz  
MDIETZ_q Modified Dietz  
MIRR Modified Internal Rate of Return
MIRR_q Modified Internal Rate of Return  
MOIC Multiple of Invested Capital
NFV Net Future Value    Not available for SQL2005
NOMINAL Annual Nominal Interest Rate
NPER Number of Periods
NPERGA Number of Periods of a Growing Annuity
NPV Net Present Value
NPV_q Net Present Value  
ODDFIPMT    new! Interest portion of a periodic payment for an annuity with an odd first period
ODDFPMT    new! Periodic payment for an annuity with an odd first period
ODDFPMTSCHED    new! Generate Amortization schedule for an annuity with odd first period (table-valued function)
ODDFPPMT    new! Principal portion of a periodic payment for an annuity with an odd first period
ODDFPV    new! Present value of an annuity with an odd first period
ODDFRATE    new! Periodic interest rate for an annuity where the first period is longer or shorter than the other periods
ODDPV Present value of an annuity with an odd first period
PMTGA Initial Payment of a Growing Annuity
PV Present Value
PVGA Present Value of a Growing Annuity
RATE Interest Rate of an Annuity
TWROR Time-weighted rate of return with market value indicators    Not available for SQL2005
TWRR Time Weighted Rate of Return    Not available for SQL2005
XDCF Discounted cash flows value of a series of irregular cash flows    Not available for SQL2005
XFV Future Value of a Cashflow between two dates
XIRR Internal Rate of Return with non-periodic cashflows
XIRR_q Internal Rate of Return with non-periodic cashflows  
XMIRR Modified Internal Rate of Return with non-periodic cashflows    Not available for SQL2005
XNFV Net Future Value for non-periodic cashflows    Not available for SQL2005
XNPV Net Present Value for non-periodic cashflows
XNPV_q Net Present Value for non-periodic cashflows  
XPV Discounted Value of a Cashflow between two dates
   
CAPM - CAPITAL ASSET PRICING MODEL
EQALPHA Intercept of the security characteristic line between an asset and a specified benchmark    Not available for SQL2005
EQBETA Correlated volatility (beta) between an asset and a specified benchmark    Not available for SQL2005
EQVOLATILITY Calculate historical volatility based upon price or valuation data    Not available for SQL2005
INFORATIO Information ratio based upon return data    Not available for SQL2005
INFORATIO2 Information ratio based upon price or valuation data    Not available for SQL2005
MAXDD    new! Calculate the maximum drawdown based on net asset or portfolio values    Not available for SQL2005
MAXDD2    new! Calculate the maximum drawdown based on net asset or portfolio returns    Not available for SQL2005
SHARPE Sharpe ratio based upon return data    Not available for SQL2005
SHARPE2 Sharpe ratio based upon price or valuation data    Not available for SQL2005
SORTINO Sortino ratio based upon return data    Not available for SQL2005
SORTINO2 Calculate the Sortino ratio based upon price data    Not available for SQL2005
TREYNOR Treynor ratio based upon return data    Not available for SQL2005
TREYNOR2 Treynor ratio based upon price or valuation data    Not available for SQL2005
   
BOND FIGURATION
ACCINTACT    new! Accrued interest where coupon amounts are based on number of days in the coupon period
AIFACTOR Accrued Interest Factor
AIFACTOR_IAM Accrued Interest Factor, Interest at Maturity
AIFACTOR_OFC Accrued Interest Factor, Odd First Coupon
AIFACTOR_OLC Accrued Interest Factor, Odd Last Coupon
AIFACTOR_RPI Accrued Interest Factor, Regular Periodic Interest
ACCRINT Accrued Interest
ACCRINTM Accrued Interest at Maturity
BONDAMORT Amortization Schedule of a Bond (table-valued function)
BONDCF    new! Cash flows for a bond paying regular periodic interest (table-valued function)
BONDINT Accrued Interest on a Bond
CFCONVEXITY Convexity of a series of cash flows    Not available for SQL2005
CFDURATION Duration of a series of cash flows    Not available for SQL2005
CFMDURATION Modified duration of a series of cash flows    Not available for SQL2005
COMPINT Accrued interest for a security where interest is compounded periodically and paid at maturity.
CONVEXITY Calculate the convexity of an option free bond
COUPDAYS Coupon Days
COUPDAYBS Coupon Days - beginning to settlement
COUPDAYSNC Coupon Days - settlement to next coupon
COUPNCD Coupon Days - next coupon date
COUPNUM Number of Coupons from settlement to maturity
COUPPCD Previous Coupon Date
DIRTYPRICE    new! Calculate the dirty price of a bond
DIRTYYIELD    new! Calculate the yield of a bond from the dirty price
DIS    new! Price, discount rate, and/or yield of a discount security
DISC Discount Rate
DISFACTORS    new! Factors for the price calculation of a discount security (table-valued function)
DURATION Annual Duration of a Security
IAM    new! Price and/or yield of a security paying interest at maturity
IAMFACTORS    new! Factors for the price calculation of a security paying interest at maturity (table-valued function)
INTRATE Interest Rate of a Security
MDURATION Macauley Duration
ODDCOMPINT Accrued interest for a security with an odd first or odd last coupon period
ODDFINT Odd First Interest
ODDFPRICE Odd First Period Price
ODDFYIELD Odd First Period Yield
ODDLINT Odd Last Interest
ODDLPRICE Odd Last Period Price
ODDLYIELD Odd Last Period Yield
OFC    new! Calculate the price and/or yield of a bond with an odd first coupon using the ODDFPRICE equation
OFCCONVEXITY    new! Convexity of a bond with and odd first coupon
OFCDURATION    new! Duration of a bond with an odd first coupon
OFCFACTORS    new! Returns the components of the ODDFPRICE equation (table-valued function)
OFCMDURATION    new! Modified duration of a bond with an add first coupon
OFL    new! Calculate the price and/or yield of a bond with an odd first and an odd last coupon using the OFLPRICE equation
OFLCONVEXITY    new! Convexity of a bond with an odd first and odd last coupon
OFLDURATION    new! Duration of a bond with an odd first and odd last coupon
OFLFACTORS    new! Returns the components of the OFLPRICE equation (table-valued function)
OFLMDURATION    new! Modified duration of a bond with an add first and odd last coupon
OFLPRICE Calculate the price of a security with an odd first and odd last period
OFLYIELD Calculate the yield of a security with an odd first and odd last period
OLC    new! Calculate the price and/or yield of a bond with an odd last coupon using the ODDLPRICE equation
OLCCONVEXITY    new! Convexity of a bond with and odd last coupon
OLCDURATION    new! Duration of a bond with an odd last coupon
OLCFACTORS    new! Returns the components of the ODDLPRICE equation (table-valued function)
OLCMDURATION    new! Modified duration of a bond with an add last coupon
PRICE Price of a Security
PRICEACT    new! Price of a bond where coupon amounts are based on number of days in the coupon period
PRICEACTV    new! Cash flows and Discount factors for a bond where coupon amounts are based on number of days in the coupon period (table-valued function)
PRICEDISC Price of a Discounted Security
PRICEFR    new! Price of a bond with forced redemptions
PRICEMAT Price at Maturity
PRICESTEP Price of a security with step-up rates  
RPI    new! Calculate the price and/or yield of a bond with regular periodic coupons
RPICONVEXITY    new! Convexity of a bond paying regular periodic interest
RPIDURATION    new! Duration of a bond paying regular periodic interest
RPIFACTORS    new! Factors for the calculation of the price of a bond that pays regular periodic interest (table-valued function)
RPIMDURATION    new! Modified duration of a bond paying regular periodic interest
RECEIVED Amount Received at Maturity
STEPACCINT    new! Accrued interest of a stepped-coupon bond  
STEPCONVEXITY    new! Convexity of a stepped-coupon bond  
STEPDURATION    new! Duration of a stepped-coupon bond  
STEPMDURATION    new! Modified duration of a stepped-coupon bond  
TBILLEQ Bond Equivalent Yield of a Treasury Bill
TBILLPRICE Price of a Treasury Bill
TBILLYIELD Yield of a Treasury Bill
YIELD Yield of a Security
YIELDACT    new! Yield of a bond where coupon amounts are based on number of days in the coupon period
YIELDDISC Yield of a Discounted Security
YIELDFR    new! Yield of a bond with forced redemptions
YIELDMAT Yield with Interest at Maturity
YIELDSTEP Yield of a security with step-up rates  
   
LOANS
AMORTRATE Constant daily effective rate for bond/loan amortization
AMORTSCHED Generate Amortization Schedule of a loan (table-valued function)
Balloon    new! Generate loan schedule with periodic interest payments and principal repaid at maturity (table-valued function)
Bullet    new! Generate loan schedule with single interest and principal payment at maturity (table-valued function)
ConstantCashFlow    new! Generate annuity loan schedule with equal periodic cash flows (table-valued function)
ConstantPaymentAmount    new! Generate loan schedule with no maturity with fixed periodic payment amount (table-valued function)
CONSTPRINAMORT    new! Generate Amortization schedule of a loan with a fixed principal repayment (table-valued function)
ConstantPrincipal    new! Generate loan schedule with fixed maturity date where the periodic principal payment is calculated on a straight-line basis (table-valued function)
ConstantPrincipalAmount    new! Generate loan schedule with no fixed maturity with a fixed periodic principal payment (table-valued function)
ConstantPrincipalRate    new! Generate loan schedule with no fixed maturity where a fixed percentage principal payment (table-valued function)
CUMIPMT Cumulative Interest paid
CUMLIPMT Cumulative Interest payments of a loan
CUMLPPMT Cumulative Principal payments of a loan
CUMPRINC Cumulative Principal paid
EFFECT Maturity and Due dates
IPMT Interest Payment based on Constant Rate
LIPMT Interest Payment of a loan
LPMT Periodic Payment of a loan
LPMTSCHED Generate Loan Amortization with balloon payment and other parameters (table-valued function)
LPPMT Principal Payment of a loan
LRATE Interest rate for an annuity with an odd first period
NPD Next payment date of a loan
NPNO Next payment number of a loan
NUMPMTS Total number of payments over the life of the loan
PAYMENTPERIODS    new! Calculate number of months until first payment date, start of grace period, end of grace period, and total number payments for a loan (table-valued function)
PMT Payment of an Annuity
PERIODRATE Adjust the nominal rate of a loan
PMTSCHED Payment Schedule of a loan (table-valued function)
PPD Previous Payment date of a loan
PPMT Principal Payment
PPNO Previous Payment number of a loan
R78IPMT Interest Payment of a loan using Rule of 78
R78PAYOFF Payment amount of a loan using Rule of 78
R78PPMT Principal Payment of a loan using Rule of 78
R78REBATE Rebate amount of a loan using Rule of 78
TOTALINT Total interest amount of a loan
UNEQUALLOANPAYMENTS Payment schedule for a loan where interest and principal payment frequencies differ(table-valued function)
   
DEPRECIATION
DB Declining Balance
DDB Double Declining Balance
SLN Straight Line Depreciation
SYD Sum-of-Year's-Digits Depreciation
VDB Depreciation using Declining Balance
   
YIELD CURVE CONSTRUCTION
DFINTERP Calculate interpolated discount factor
NELSONSIEGEL Calculate the zero coupon rate using Nelson Siegel formula
NSCOEF Calculate the Nelson Siegel coefficients for a zero coupon curve   (table-valued function)
NSCOEF2 Calculate the Nelson Siegel coefficients for a zero coupon curve   (table-valued function)
INTERPDFACT Calculate interpolated discount factors for a range of dates   (table-valued function)
SWAPCURVE Calculate discount factors from a series of cash, futures, and swaps rates   (table-valued function)
TENOR2DATE Convert an alphanumeric expression ('tenor') to a swaps or money market maturity date
ZEROCOUPON Calculate an interpolated zero-coupon rate from a series of cash, futures, or swaps rates  
   
BUSINESS DAYS CALCULATIONS
BUSDAYS Calculate number of Business Days
BUSDAYSWE    new! Calculate number of Business Days using specified weekend days
BUSINESSDATE Calculate a Business Date from an offset
BUSINESSDATEWE Calculate a Business Date from an offset and specified weekend days
CALCDATE Convert MDY to date
DATEFLOAT Convert MDY to float
DATEINT Convert MDY to int
DAYS360 Calculate number of days using 30/360 day count conventions
DAYSINMONTH    new! Calculate number of number of days in the month of the specified date
DAYSINYEAR    new! Calculate number of number of days in the year of the specified date
DAYSNL Calculate number of days excluding Leap Years
EASTER Calculate date of Western Easter for a given year
EDATE Calculate Exact Date n months from specified date
ED_FUTYF Calculate futures contract time in years
ED_FUT2DATE Convert a Eurodollar futures delivery code into a delivery date
EOMONTH Last Day of Month
FIRSTWEEKDAY First specified day of the week in any calendar month
ISREGULARPAY Determine if a date is a regular payment date for a loan
LASTWEEKDAY Last specified day of the week in any calendar month
NBD Convert a series of dates to flat csv string in YYYYMMDD format
NUMMONTHS    new! Calculate number of months between two dates
TENOR2DATE Convert an alphanumeric expression ('tenor') to a swaps or money market maturity date
YEARFRAC Fraction of Year
   
   
OTHER
DOLLARDE Dollar - fraction to Decimal
DOLLARFR Dollar - decimal to Fraction
ED_FUT_CONV_ADJ_HL Convert Eurodollars futures price to forward rate using Ho Lee convexity adjustment
RelativeError Calculate the relative error between two values
   
XLDB_FINANCIAL_VERSION Version Information

This function cannot reference data from SQL Server 2014 memory-optimized tables

 



 |  View Topic History  |
Copyright 2008-2013 WestClinTech LLC         Privacy Policy        Terms of Service