Technical data
Creating Rules, Formul as, and User Functions Chapter 10
You can use parentheses to override the precedence o f operators. For example, the rule (3+2)*4
evaluates as 20, because the analytic calculation engine first evaluates the operation within parentheses. You
can nest parentheses to exercise more control of precedence; the operations within the inner sets of parentheses
are evaluated first. For example, the analytic calculation engine calculates the rule (8+(3+2)*4)
*(6+7)in the order described in this table:
Order of Execution Operation Resulting Value
1 3+2
=5
2
5*4
=20
3 8+20 =28
4 6+7 =13
5
28*13
= 364
The analytic calculation engine performs the multiplication of 5*4beforetheaddition of 8. The analytic
calculation engine performs multiplication before addition unless you override this order of execution with
parentheses.
Note. If you use parentheses, you must balance each opening parenthesis with a closing parenthesis. If you
do not balance the parentheses, the analytic calculation engine generates an Unbalanced parentheses error.
When this situation o ccurs, you must correct the rule.
S
ee C
hapter 10, “Creating Rules, Formulas, and User Functions,” Understanding Rule Error Messag es,
p
age 114.
Values
A value is a number or a text string. For example, the NET_PRESENT_VALUE data cube contains this rule:
NPV(MONTHS, ANNUAL_DISCOUNT_RATE / 12, NET_REVENUE_BY_PRODUCT). In this rule, the
value is 12.
D
ata Cube References
Use a data cube reference to refer to a specific data cube. For example, you can use data cube references to
multiply the values of two data cubes and place the calculation totals in a result data cube. Using this example,
the PROD_SALES data cube contains the following rule: UNIT_COST * UNITS_SOLD.
Member References
Use a member reference to refer to a dimension member to access its data or to perform a calculation. Use the
following syntax to refer to a member:
[DIMENSION_NAME:Member]
For example, you could use this member reference to refer to the Hard Drives member from the PRODUCTS
dimension: [PRODUCTS: Hard Drives]
126 Copyright © 1988-2007, Oracl e. All rights reserved.