Use Case 3: Add Custom Dimension to a Prebuilt Fact
You can add a custom dimension folder containing descriptive attributes and join the custom dimension to a prebuilt fact table with defined keys.
The prebuilt SCM – Sales Order subject area doesn’t contain the required Custom Item Department dimension attribute. In this use case, you add a folder Custom Item Department to the SCM – Sales Orders prebuilt subject area. This folder contains the Department attribute. The custom dimension is joined to the prebuilt Fact – OM Sales Orders fact using a composite key of Organization ID and Inventory Item ID.
This use case requires Fusion SCM Analytics subscription. However, you can apply the concepts covered in this use case to any other Fusion Data Intelligence subscription. The use case may reference Autonomous Data Warehouse prebuilt tables and synonyms and mock custom database tables and views. If you’ve activated the specified Fusion Data Intelligence subscription, you may use the samples provided. The recommendation is to substitute the sample objects for your own custom Autonomous Data Warehouse objects such as custom table, materialized view, view, custom synonym, or data augmentation dataset synonym.
- Attribute - Department
- Subject area - SCM - Sales Orders
- Fact folder - Dim - OM Sales Orders
- Create a sandbox titled MySandbox5Mar25. See Create Sandbox. Or, edit an existing sandbox on the Semantic Model Extensions page; for example, by clicking the MySandbox5Mar25 sandbox.
- Generate the sample dimension view FDI_X_ITEM_CUSTOM_DEPARTMENT_D_V
using this SQL
script:
CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."FDI_X_ITEM_CUSTOM_DEPARTMENT_D_V" ("ORG_ITEM_KEY", "ORGANIZATION_ID", "INVENTORY_ITEM_ID", "DEPARTMENT") DEFAULT COLLATION "USING_NLS_COMP" AS ( SELECT ORGANIZATION_ID || INVENTORY_ITEM_ID AS ORG_ITEM_KEY, ORGANIZATION_ID, INVENTORY_ITEM_ID, CASE SUBSTR(INVENTORY_ITEM_ID,-1,1) WHEN '1' THEN 'Clothing' WHEN '2' THEN 'Shoes' WHEN '3' THEN 'Cosmetics' WHEN '4' THEN 'Furniture' WHEN '5' THEN 'Gardening' WHEN '6' THEN 'Hardware' WHEN '7' THEN 'Home Appliances' WHEN '8' THEN 'Houseware' WHEN '9' THEN 'Paint' WHEN '0' THEN 'Sporting Goods' ELSE 'Other' END DEPARTMENT FROM OAX$OAC.DW_INVENTORY_ITEM_D );
- Grant semantic model access to the FDI_X_ITEM_CUSTOM_DEPARTMENT_D_V
view for the OAX$OAC schema using the following SQL
script:
GRANT SELECT ON "OAX_USER"."FDI_X_ITEM_CUSTOM_DEPARTMENT_D_V" TO "OAX$OAC";
- Validate that the data is loading from the sample as expected using the
following SQL
script:
SELECT * FROM OAX_USER.FDI_X_ITEM_CUSTOM_DEPARTMENT_D_V;
Add a Custom Dimension to the Semantic Model
You edit the logical star to define the autonomous data warehouse object, attributes, display labels, keys, and hierarchy.
Add Physical Column to a Prebuilt Fact
You extend the prebuilt fact to expose physical columns that you use as keys to join the new custom dimension in the logical star.
Join the Custom Dimension to the Prebuilt Fact
You join the custom dimension to the prebuilt fact by defining the join type, join condition, and context level. You can define complex joins; however, the recommendation is to try and use standard joins where possible.
Present the Custom Dimension in the Semantic Model
You modify the subject area to present the new custom dimension and its attributes. The dimension is represented as a folder containing columns in the subject area.
Apply and Publish the Customizations
You apply the changes to compile the sandbox and ensure that the sandbox is error free.
Then, you use the Activity tab to debug, resolve errors, and confirm that the Apply Changes action completes and is successful. Finally, you merge the changes to the main sandbox and publish the main user extensions to share the new extensions with consumers.
In this step, you apply the changes, use the Activity tab to monitor the status, merge the MySandbox5Mar25 sandbox to the Main sandbox, and then publish the main user extension.