Click the Expression Builder button to the right of the Formula column. In the Expression Builder - Aggregate dialog, from the Formula list, select the To change the order in which the dimension-specific rules are performed, click Up

Working with Logical Tables, Joins, and Columns 8-17 over the individual accounts. The Oracle BI Server lets you configure dimension-specific aggregation rules. You can specify one aggregation rule for a given dimension and specify other rules to apply to other dimensions. You need to configure dimensions in the Business Model and Mapping layer to set up dimension-specific aggregation. For more information about setting up aggregate navigation, see Chapter 10 . To specify dimension-specific aggregation rules for a single logical column: 1. In the Business Model and Mapping layer, double-click a logical column. 2. In the Logical Column dialog, click the Aggregation tab.

3. In the Aggregation tab, select Based on dimensions.

4. In the Browse dialog, select a dimension over which you want to aggregate, and then click OK.

5. In the Aggregation tab, from the Formula list, select a rule.

After selecting rules for specified dimensions, set the aggregation rule for any remaining dimensions by using the dimension labeled Other.

6. If you need to create more complex formulas, click the Expression Builder button

to the right of the Formula column to open Expression Builder. 7. If you have multiple dimensions, you can click Up or Down to change the order in which the dimension-specific rules are performed. When calculating the measure, aggregation rules are applied in the order top to bottom established in the dialog.

8. Click OK.

To specify dimension-specific aggregation rules for multiple logical fact columns: 1. In the Business Model and Mapping layer, select multiple logical fact columns.

2. Right-click and select Set Aggregation.

You must select more than one column to see the Set Aggregation menu item. Also note that Set Aggregation does not appear if one or more of the columns you select is a derived column.

3. In the Aggregation dialog, select or clear All columns the same.

This option is selected by default. When selected, you can set aggregation rules that apply to all selected columns. If you clear this option, you can set aggregation rules separately for each selected column.

4. In the Aggregation tab, select Based on dimensions.

5. In the Browse dialog, select a dimension over which you want to perform aggregation, and then click OK. After setting up the rule for a dimension, specify aggregation rules for any other dimensions in the entry labeled Other.

6. Click the Expression Builder button to the right of the Formula column.

7. In the Expression Builder - Aggregate dialog, from the Formula list, select the

aggregation to perform over the dimension.

8. To change the order in which the dimension-specific rules are performed, click Up

or Down, and then click OK. 8-18 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition When calculating the measure, aggregation rules are applied in the order top to bottom established in the dialog. Defining Aggregation Rules for Multidimensional Data Sources This section describes best practices for defining aggregation rules for logical measures sourced from Essbase, Oracle OLAP, and other multidimensional data sources, like Microsoft Analysis Services and SAPBW. By default, when you import Essbase and some other multidimensional cubes into the Physical layer, Oracle Business Intelligence cannot read the aggregation rules set within the data source. Because of this, the measures are imported automatically with the default aggregation rule of External Aggregation. Note that this rule is only available for multidimensional data sources. External Aggregation means that the Oracle BI Server is not aware of the underlying aggregation rule for the specific measure and will not compute it internally. Instead, the Oracle BI Server will always ship the query to the underlying multidimensional data source for aggregation. Because the underlying data sources are extremely efficient, pushing the aggregation rules down to the data source ensures that the Oracle BI Server returns the results without adding any additional overhead in processing. However, it is recommended that you update the aggregation rule for each measure in Oracle Business Intelligence with the corresponding aggregation rule defined in the data source. Doing so ensures that the Oracle BI Server can do additional computations when needed. There is no query performance impact, since the Oracle BI Server still pushes down optimized queries wherever possible. You must ensure that the aggregation rule defined in Oracle Business Intelligence matches the rule in the underlying data source. Also, you must set the appropriate aggregation rule in both the Physical layer and Business Model and Mapping layer, as shown in Figure 8–3 . Note: If the Oracle BI Server needs to do additional aggregation for a particular query, and the aggregation rule is set to the default of External Aggregation, the server returns the following error: An external aggregate is found in an outer query block. This error occurs because the Oracle BI Server cannot read the aggregation rule in the underlying data source. To ensure that correct results are returned for these queries, you should change the aggregation rules set in the Oracle BI repository to match the aggregation rules set in the underlying data source. Working with Logical Tables, Joins, and Columns 8-19 Figure 8–3 Setting Aggregation Rules in the Physical and Business Model and Mapping Layers for Multidimensional Sources For custom aggregations or aggregations which do not have a corresponding function within the Oracle BI Server, it is recommended to leave the aggregation as External Aggregation for both the physical measure column and its corresponding logical measure column. Associating an Attribute with a Logical Level in Dimension Tables Attributes can be associated with a logical level by selecting the dimensional level on the Levels tab. Measures can be associated with levels from multiple dimensions and always aggregate to the levels specified. Note: For Oracle OLAP data sources, you do not explicitly set Physical layer aggregation rules for Oracle OLAP columns. Because of this, you only need to set the aggregation rule for Oracle OLAP columns in the Business Model and Mapping layer. In addition, if a query requests an aggregate that does not exist in the Oracle OLAP data source, and the aggregation rule is set to External Aggregation, then the Oracle BI Server returns an error. To avoid this error, make sure to explicitly set the aggregation rule for the Oracle OLAP column in the Business Model and Mapping layer. If you do not explicitly set the aggregation rule for Oracle OLAP columns to something other than External Aggregation, requests from Oracle BI Presentation Services custom groups will fail, because custom groups always request aggregates that do not exist in the data source. 8-20 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition Dimensions appear in the Dimensions list. If this attribute is associated with a logical level, the level appears in the Levels list. Another way to associate a measure with a level in a dimension is to expand the dimension tree in the Business Model and Mapping layer, and then use drag-and-drop to drop the column on the target level. For more information about level-based measures, see Example 9–1 . To associate a measure with a logical level in a dimension: 1. In the Business Model and Mapping layer of the Administration Tool, double-click a logical column. 2. In the Logical Column dialog, click the Levels tab.

3. In the Levels tab, click the Logical Level field for the dimension from which you