Click Browse beside the Member Key field. Select a Member Key for the parent-child hierarchy and click OK. Click Browse beside the Parent Key field.

Working with Logical Dimensions 9-17 To achieve the correct aggregation for dimensions of this type, you must first determine what you want to see as a grand total when the parent-child hierarchy is aggregated. For example, assume that your hierarchy contains a single root member, and you want to display the preaggregated value for this root member. In this case, you first create an additional fact logical table source mapped at the Total level of the parent-child hierarchy. Then, in the logical table source, create a WHERE clause filter that selects only the root member. With this model in place, for queries that are at the Total level of the parent-child hierarchy, the Oracle BI Server selects the aggregate logical table source and applies the root member WHERE clause filter. For queries that are at the Detail level, the Oracle BI Server selects the detailed logical table source and returns the preaggregated member values. In either case, it does not matter how the aggregation rule is set, because there is a preaggregated source at each level. Note that this approach only works if the queries are either at the Total or Detail level of the parent-child dimension. However, for queries that group by some non-unique attribute of the parent-child dimension, the aggregation might not be correct. For example, if an Employee dimension has a Location attribute, and a query groups by Employee.Location, then there will likely be some double counting because an employee often reports to other employees at the same location. Because of this, when fact tables contain preaggregated member values, you should avoid grouping by non-unique attributes of the parent-child dimension. If grouping by those attributes is unavoidable, then you should model them as separate dimensions. Creating Dimensions with Parent-Child Hierarchies The key elements that you must define for a parent-child hierarchy are the identifier columns for the member and the parent of the member. This basic principle applies to all parent-child hierarchies, regardless of the data source from which the hierarchy is derived. Parent-child hierarchies that are based on relational tables must have an accompanying parent-child relationship table. See About Parent-Child Relationship Tables for more information. To create dimensions with a parent-child hierarchy: 1. In the Business Model and Mapping layer of the Administration Tool, perform one of the following steps: ■ Right-click a business model and select New Object Logical Dimension Dimension with Parent-Child Hierarchy . Note that this option is only available if there is at least one logical dimension table in the business model that has no dimension associated with it. ■ Right-click a dimension table that is not associated with any dimension and select Create Logical Dimension, then select Dimension with Parent-Child Hierarchy . 2. In the Logical Dimension dialog, in the General tab, type a name for the dimension.

3. Click Browse beside the Member Key field.

The Browse window shows the logical dimension tables in the business model, each with their primary keys.

4. Select a Member Key for the parent-child hierarchy and click OK.

5. Click Browse beside the Parent Key field.

9-18 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition The Browse window shows the columns, other than the primary key, in the logical table that you selected in step 4. 6. Select a column that will be the Parent Key for the parent-child hierarchy and click OK . 7. If the logical table that you selected in step 4 is not from a relational table source, click OK to finish the process of creating the dimension. If the logical table you selected in step 4 is from a relational table source, you must continue the dimension definition process by setting up the parent-child relationship table for the hierarchy. See Defining Parent-Child Relationship Tables for details. Defining Parent-Child Relationship Tables For parent-child hierarchies based on relational tables, you must define a parent-child relationship table. See About Parent-Child Relationship Tables for more information. When you create the parent-child relationship table, you must choose one of the following options: ■ Select a previously-created parent-child relationship table ■ Use a wizard that will generate scripts to create and populate the parent-child relationship table To define parent-child relationship tables: 1. In the Logical Dimension dialog, click Parent-Child Settings. The Parent-Child Relationship Table Settings windows appears, with the Logical Table and Logical Table Source values filled in. Figure 9–5 shows the Parent-Child Relationship Table Settings dialog. Figure 9–5 Parent-Child Relationship Table Settings Dialog 2. You can either manually define the parent-child relationship table for the hierarchy, or you can start a wizard that will perform the definition for you recommended. ■ To start the manual process, continue at step 3. Working with Logical Dimensions 9-19 ■ To start the wizard, continue at step 7.

3. Click the Select Parent-Child Relationship Table button to start the manual