Technical data

Using Built-in Functio ns in Analytic Models Chapter 11
Parameters
Parameter Description
Dimension The dimensio
ntouse.
Direction The direction to l oop through the member s (#FORWARD or #REVERSE ).
Expression The expression to evaluate for each iteration.
Example
Consider the following formula that uses DLOOKUP:
DLOOKUP(RANGES, COMMISSION_RATE, SALES >= SALES_LEVEL, #REVERSE)
You could achieve the same thing with the FORMEMBERS function:
FORMEMBERS(RANGES, #REVERSE,
IF(SALES >=
SALES_LEVEL, RETURN(COMMISSION_RATE))
);
RETURN(0)
Of course, in this case it is simpler just to use the DLOOKUP function, but the FORMEMBERS function
makes it possible to perform more sophisticated lookups and tabulations. For example, the following formula
returns the product that has the highest sales:
FORMEMBERS(PRODUCTS, #FORWARD,
IF(SALES > &
MaxSales,
SET(&MaxSales, SALES);
SET(&Product, MEMBER(PRODUCTS))
)
);
&Product
Following is how you would have to do it without procedural logic:
DLOOKUP(PRODUCTS, MEMBER(PRODUCTS), SALES = DMAX(PRODUCTS, SALES))
The above version is shorter, but it is much less efficient than the version that uses procedural logic, because it
calculates the DMAX repeatedly for ev ery product.
You c oul d eli
minate some of the redundancy by using an expression block a nd a variable:
SET(&MaxSales, DMAX(PRODUCTS, SALES));
DLOOKUP(PRODUCTS, MEMBER(PRODUCTS), SALES = &MaxSales)
The previous version is more effective than the version that does not use procedural logic, but it is not as
effective as the version that uses procedural logic. This is because in the version that does not use procedural
logic, the FORMEMBERS function only loops through the products once. In the previous version, it loops
through them twice—once for the DMAX and once for the DLOOKUP—although the DLOOKUP stops
when it finds the right product.
FV
Syntax
FV(Rate, NPer, Pmt, PV, {Type})
158 Copyright © 1988-2007, Oracl e. All rights reserved.