Creating Calculation Specifications |
Calculation specifications are OLAP DML objects that contain OLAP DML statements that specify analysis that you want performed.
Using the OLAP DML you can define objects that are specifications for different types of OLAP calculation:
Formulas—A formula is a saved expression.
Aggregations—An aggregation is a specification for how data should be aggregated.
Allocations—An allocation is a specification for how data should be allocated down a hierarchy.
Models—A model is a set of interrelated equations. The calculations in an equation can be based either on variables or on dimension values. You can assign the results of the calculations directly to a variable or you can specify a dimension value for which data is being calculated.
Programs—An OLAP DML program is a collection of OLAP DML statements that helps you accomplish some workspace management or analysis task. You can use OLAP DML programs as user-defined commands and functions.
The general process of creating a calculation specification object is the following two step process:
Define the calculation object using the appropriate DEFINE statement.
Add the calculation specification to the object definition. You can add the calculation specification to the definition of a calculation object in the following ways:
At the command line level of the OLAP Worksheet, in an input file, or as an argument to a PL/SQL function. In this case, ensure that the object is the current object (issue a CONSIDER statement, if necessary), and, then, issue the appropriate statement that includes the specification as a multiline text argument. To code the specification as a multiline text, you can use a JOINLINES function where each of the text arguments of JOINLINES is a statement that specifies the desired processing, and where the final statement is END.
In an Edit Window of the OLAP Worksheet. In this case, at the command line level of the OLAP Worksheet, issue an EDIT statement with the appropriate keyword. This opens an Edit Window for the specified object. You can then type each statement as an individual line in the Edit Window. Saving the specification and closing the Edit Window when you are finished.
Table: Commands for Defining Calculation Specifications outlines the OLAP DML statements that you use to create each type of calculation specification.
Commands for Defining Calculation Specifications
| Calculations | Definition Statement | Specification Statement | For More Information |
|---|---|---|---|
| Aggregation | DEFINE AGGMAP
|
AGGMAP
|
"Aggregations"
|
| Allocation | DEFINE AGGMAP
|
ALLOCMAP
|
"Allocations"
|
| Formula | DEFINE FORMULA
|
EQ
|
"Formulas"
|
| Model | DEFINE MODEL
|
MODEL
|
Models
|
| Program | DEFINE PROGRAM
|
PROGRAM
|
Programs
|