|Oracle® OLAP DML Reference
11g Release 2 (11.2)
Part Number E17122-05
The EQ command specifies a new expression for an already defined formula. To use EQ to assign an expression to a formula definition, the definition must be the one most recently defined or considered during the current session. When it is not, you must first use a CONSIDER command to make it the current definition.
An alternative to the EQ command is the EDIT FORMULA command, which is available only in OLAP Worksheet. The EDIT FORMULA command opens an Edit window in which you can add, delete, or change the expression to be calculated for a formula.
Be sure to distinguish between the EQ command described here and the EQ operator used to compare values of the same type.
The calculation that is performed to produce values when you use the formula. When you do not specify an expression, the EQ command sets the expression to
NA. The formula text is not converted to uppercase.
Data Type and Dimensions
Typically, the data type and dimensions of the new expression match the specified data type and dimensions in the definition of the formula. When they do not, the resulting values are converted to the formula's data type and the results are forced into the formula's dimensionality. The DESCRIBE command shows the formula's data type and dimensions. You can find out the data type and dimensions of the new expression by parsing it. See Example 9-115, "Using PARSE with EQ".
You cannot use the EQ command to change the data type or dimensions of a formula. To make changes in these, you must delete the formula and redefine it.
Example 9-114 Adding an EQ
This example specifies a new expression for the
f1 formula with the following definition.
DEFINE f1 FORMULA INTEGER <month line division> EQ actual * 2
CONSIDER f1 EQ actual * 3 DESCRIBE f1
produce the following definition of the formula with a new EQ.
DEFINE F1 FORMULA INTEGER <MONTH LINE DIVISION> EQ actual * 3
Example 9-115 Using PARSE with EQ
The following example supposes that your workspace already has a formula named
line.totals. The PARSE and SHOW INFO statements check the dimensionality and data type of an expression. The CONSIDER and EQ statements assign the expression to the
line.totals formula. The
line.totals formulas has the following definition.
DEFINE line.totals FORMULA DECIMAL <year line>
PARSE 'total(actual line year)' SHOW INFO(PARSE DIMENSION)
produce the following output.
SHOW INFO(PARSE DATA)
produces the following output.
The output from INFO(PARSE) shows that the expression has the same dimensionality and data type as the
line.totals formula. The statements
CONSIDER line.totals EQ TOTAL(actual line year) DESCRIBE line.totals
show the definition of
line.totals with its new EQ.
DEFINE LINE.TOTALS FORMULA DECIMAL <YEAR LINE> EQ total(actual line year)