Before you Begin
Learn how to create logical parent-child hierarchies and presentation layer objects in your semantic model.
Background
This tutorial describes the Semantic Modeler which is currently available for preview. Ask your administrator to enable the Semantic Modeler preview feature in Console.
This is the next tutorial in the Create a Semantic Model series. Do the tutorials in the order listed:
- Create the Physical Layer
- Create the Logical Layer
- Create the Presentation Layer
- Test, Deploy, and Validate a Semantic Model
- Examine Semantic Model Markup Language (SMML) and Integrate Semantic Model With a Git Repository
- Add a Presentation Object
- Create Logical Hierarchies
- Create Calculated, Level-Based, and Share Measures
- Create Ragged and Skipped Level Hierarchies
- Create Parent-Child Hierarchies
- Create Aggregate Tables
- Create Time Series Measures
- Create Initialization Blocks and Variables
What Do You Need?
- Access to Oracle Analytics Cloud
- Access to the Sample Sales Semantic Model
Add Physical Tables and Create Alias Tables
In this section, you add tables from the BISAMPLE data source to the physical layer of your semantic model, create alias tables, and define joins between the alias tables.
- If you closed your semantic model, sign in to Oracle Analytics Cloud with your BI Data Model Author application role or service administrator credentials. On the Home page, click the Navigator, and then click Semantic Models.
- In the Semantic Models page, select Sample Sales, click Actions menu, and then select Open.
- Click the Physical Layer
. Double-click MySampleSalesDatabase. Under Tables, expand the BISAMPLE schema.
- In the Connections
pane, expand the BISAMPLE schema. Hold down the Ctrl key and select SAMP_EMPL_D_VH, SAMP_EMPL_PARENT_CHILD_MAP, and SAMP_EMPL_POSTN_D.
- Drag the selected tables to BISAMPLE in the Physical Layer
. Drop the tables when Add
appears. Click Save
.
- Under Tables in the BISAMPLE schema, right-click SAMP_EMPL_D_VH and select Create Physical Table Alias.
- In Create Physical Table Alias, enter
D50 Sales Rep
in Name, and then click Add. - Right-click SAMP_EMPL_PARENT_CHILD_MAP and click Create Physical Table Alias.
- In Create Physical Table Alias, enter
D51 Sales Rep Parent Child
, and then click Add. - Right-click SAMP_EMPL_POSTN_D, click Create Physical Table Alias.
- In Create Physical Table Alias, enter
D52 Sales Rep Position
, and then click Add. Click Save.
Description of the illustration sales_rep_alias_tables.png
Create Joins
In this section, you define the joins between the added table and the existing F1 Revenue table.
- In MySampleSalesDatabase, click Add Join
. In Add Physical Join, click List
in Left table, expand MySampleSalesDatabase, and select D50 Sales Rep. Under Right Table, click List
, expand MySampleSalesDatabase, and select D52 Sales Rep Position.
- In Join Conditions, click List
under the Left Table, and select POSTN_KEY. Click List
under the Right Table, select POSTN_KEY, and then click Add.
- Click Add Join
. In Add Physical Join, click List in Left table, expand MySampleSalesDatabase, and select D51 Sales Rep Parent Child. Under Right Table, click List
, expand MySampleSalesDatabase, and select D50 Sales Rep.
- In Join Conditions, click List
under the Left Table, and select ANCESTOR_KEY. Click List
under the Right Table, select EMPLOYEE_KEY, and then click Add.
- Click Add Join
. In Add Physical Join, click List
in Left table, expand MySampleSalesDatabase, and select F1 Revenue. Under Right Table, click List
, expand MySampleSalesDatabase, and select D51 Sales Rep Parent Child.
- In Join Conditions, click List
under the Left Table, and select EMPL_KEY. Click List
under the Right Table, select MEMBER_KEY, and then click Add.
Description of the illustration pl_tables_joins.png - In the Physical Layer, right-click D51 Sales Rep Parent Child, select Show Physical Diagram, and then click Selected Tables and Direct Joins.
Description of the illustration physical_diagram.png
Add Logical Table
In this section you add a logical table and select columns from a physical layer table.
- Click Logical Layer
, and double-click Sample Sales BM.
- In Dimensions, click Add Table
, and then click Create New Table.
- In Create Logical Table, enter
D5 Sales Rep
in Name and click Add.The D5 Sales Rep Columns tab opens in the Semantic Modeler.
- Click the Physical Layer
, expand MySampleSalesDatabase, and then expand BISAMPLE.
- Expand D50 Sales Rep, hold down the Ctrl key, select all the columns in D50 Sales Rep, and drag them to the D5 Sales Rep columns tab. Click Save
.
Description of the illustration d5_sales_rep_columns.png - Click the General tab, click Primary Key, and then select EMPLOYEE_KEY. Click Save
.
Add Source Tables and Columns
In this section, you update the logical layer table's sources.
- In D5 Sales Rep, click the Sources tab. Double-click D50 Sales Rep. Click Save
.
- Click Detail View
. In Table Mapping, click Add Table
.
- In Select Physical Table, expand BISAMPLE, click D52 Sales Rep Position, and then click Select. Click Save.
- Click the Sources tab. In Table Mapping, click Add Table
, and add D51 Sales Rep Parent Child. Click Save.
- Click the Columns tab. Hold down the Ctrl key, select MEMBER_KEY, ANCESTOR_KEY, IS_LEAF, and then click Delete
. Click Save
.
Rename Columns
In this section, you rename columns to use names that are easy to understand.
- In the D5 Sales Rep Columns tab, double-click POSTN_KEY. Enter
Position Key.
- Double-click TYPE. Enter
Sales Rep Type
. - Double-click EMPL_NAME. Enter
Sales Rep Name
. - Double-click EMPLOYEE_KEY. Enter
Sales Rep Number
. - Double-click HIRE_DT. Enter
Hire Date
. - Double-click MGR_ID. Enter
Manager Number
. - Double-click POSTN_DESC. Enter
Position
. - Double-click POSTN_LEVEL. Enter
Position Level
- Double-click DISTANCE. Enter
Closure Distance
. Click Save.
Description of the illustration column_rename.png - Close D5 Sales Rep.
Create a Logical Join
In this section, you create joins between the sales rep alias tables and the F1 Revenue table.
In this section, you define the join between D5 Sales Rep and the F1 Revenue tables.
- Click the Logical Layer
. Expand Sample Sales BM, right-click D5 Sales Rep, select Show Logical Diagram, and then click Selected Table and Direct Joins.
- Drag F1 Revenue to the Logical Diagram. Select F1 Revenue and draw the join to D5 Sales Rep.
- In the Add Join dialog, click Add. Click Save
.
Description of the illustration logical_join_d5_sales.png
Create a Parent-Child Hierarchy
In this section, you create a parent-child hierarchy, set the member key, and set the parent key.
- In the Logical Layer
, double-click D5 Sales Rep.
- In D5 Sales Rep, click the Hierarchy tab. From Hierarchy Type, select Parent-Child.
- Under Parent-Child, click Detail.
- In Detail, select Sales Rep Number from Member Key, select Sales Rep Name from Display Key, and then select Manager Number from Parent Key.
Description of the illustration pc_hier_detail.png - Click Select to define the parent-child relationship table.
- In Select Physical Table, click D51 Sales Rep Parent Child and click Select.
- Under the Relationship Table, select MEMBER_KEY from Member Key, select ANCESTOR_KEY from Parent Key, select DISTANCE from Relationship Distance, and then select IS_LEAF from Leaf Node Identifier. Click Save
.
Description of the illustration relationship_table.png
Specify Content Level of Detail
In this section, you specify the level of content detail in the parent child hierarchy.
- In D5 Sales Rep, click the Columns tab. Double-click Sales Rep Name. Under Level, select Detail.
- Double-click Sales Rep Number. Under Level, select Detail. Click Save
.
- Click the Hierarchy tab. In Level Name, enter
Sales Rep Total
to replace Total. - Click the Detail level. In Level Name, enter
Sales Rep Detail
to replace Detail. Click Save.
- Click the Columns tab. Double-click Sales Rep Name. Under Level, select Sales Rep Detail. Double-click Sales Rep Number. Under Level, select Sales Rep Detail. Click Save
.
Description of the illustration sales_rep_level_detail.png
Create Presentation Layer Objects
In this section, you create the Sales Rep presentation table and presentation hierarchies.
- Click the Presentation Layer
. Double-click the Sample Sales subject area.
- In the Tables tab, click Add Tables
, and then click Add Table.
- In Select Logical Table, click D5 Sales Rep and click Select.
- Double-click D5 Sales Rep in the Tables tab.
- In D5 Sales Rep, click the General tab. In Name, enter
Sales Rep
to replace D5 Sales Rep, and then click Save.
- In Sales Rep, click the Hierarchies tab.
- In the Hierarchies tab, click Sales Rep Detail. Next to Display Columns, click Replace. In Select Presentation Column, click Sales Rep Name and click Select.
Description of the illustration sales_rep_hierarchy.png - Click Save
.
Next Steps
Learn More
Create Parent-Child Hierarchies in Oracle Analytics
F578282-01
September 2022
Copyright © 2022, Oracle and/or its affiliates.
Learn how to create parent-child hierarchies in the logical layer of a semantic model in Oracle Analytics
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government's use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.