Technical data
Using Built-in Functio ns in Analytic Models Chapter 11
Example
If you take out a
loan for 50,000 USD at a rate o f 14 percent per year and 120 monthly payments, you can
create a PAY ME
NT cube and compute the payment required to repay the loan as follows:
PMT(0.14 / 12, 1
20, 50000, 0) = -776.33
If the loan has a balloon payment of 30,000 USD at the end of the 120 months, compute the payment as follows:
PMT(0.14 / 12,
120, 50000, -30000) = -660.53
If the payments are made at the start of the month rather than the end of the month, use the following formula:
PMT(0.14 / 12, 1
20, 50000, -30000, 1) = -652.92
PREV
Syntax
PREV(Dimensi
on, Data, {Count})
Description
The PREV function returns the value of Data from Count members back in Dimension.IfCount is omitted,
it is assumed to be 1.
Note. The PREV function operates on d etail member names that are persisted in the main record. This
function does not use trees to determine the order of members.
Returns
The PREV funct
ion returns the value of Data from Count members back in Dimension.IfCount is omitted,
it is assumed t
obe1.
Example
To refer to the previous month’s sales in a formula, use PREV(MONTHS, SALES).
Suppose that you want to forecast the total monthly receipts for a company, assuming that some of each
month’s sales are received immediately, some are rece ived in one month, some are receive d in two months,
and some are received in three months. First, define data cubes that contain the estimated percentage
of sales received for each time period: PCT_RECV_IMMEDIATELY, PCT_RECV_IN_1_MONTH,
PCT_RECV_IN_2_MONTHS, PCT_RECV_IN_3_MONTHS. Next, define a monthly data cube called
SALES that contains the sales forecast for each month. Calculate the TOTAL_MONTHLY_RECEIPTS
data cube with these formulas:
• RECV_IMMEDI
ATELY data cube formula:
PCT_RECV_IM
MEDIATELY * SALES
• RECV_IN_1_MONTH data cube formula:
PCT_RECV_IN_1_MONTH * PREV(MONTHS, SALES)
• RECV_IN_2_MONTHS data cube formula:
PCT_RECV_IN_2_MONTHS * PREV(MONTHS, SALES, 2)
•RECV_IN_3_
MONTHS data cube formula:
182 Copyright © 1988-2007, Oracl e. All rights reserved.