Use Case 4: Add a Custom Fact
You can add a custom fact containing aggregable metrics and join it to prebuilt dimensions with defined keys.
The prebuilt SCM – Sales Order subject area doesn’t contain the required Fact – My Custom fact metrics. In this use case, you add a folder Fact – My Custom to the SCM – Sales Orders prebuild subject area. This folder contains a sum aggregation metric labelled Custom Measure. The custom fact is joined to three prebuilt dimensions Dim – Inventory Organization, Dim – Inventory Item, and Dim – Date Gregorian Calendar using foreign keys defined in the custom fact.
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.
- Existing dimensions:
- Dim – Inventory Item
- Dim – Inventory Organization
- Dim - Date Gregorian Calendar
- 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.
- Create the sample dimension view titled FDI_X_CUSTOM_FACT_F_V using
this SQL
script:
CREATE OR REPLACE VIEW FDI_X_CUSTOM_FACT_F_V AS ( SELECT ORDERED_DATE, ORGANIZATION_ID, INVENTORY_ITEM_ID, COUNT(*) AS CUSTOM_MEASURE FROM DW_OM_FULFILLMENT_CF GROUP BY ORDERED_DATE, ORGANIZATION_ID, INVENTORY_ITEM_ID );
- Grant semantic model access to the FDI_X_CUSTOM_FACT_F_V view for
the OAX$OAC schema using the following SQL
script:
GRANT SELECT ON "OAX_USER"."FDI_X_CUSTOM_FACT_F_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_CUSTOM_FACT_F_V;
Add Custom Fact to the Semantic Model
You create a logical star to define the autonomous data warehouse object, fact measure, display labels, keys, aggregation rules, and content levels.
Join Custom Fact to Prebuilt Dimensions
You add prebuilt dimensions and join them to the custom fact using foreign keys defined in the custom fact.
Present the Custom Fact in the Semantic Model
You modify the subject area to present the new custom fact and its aggregable metrics. The system presents the custom fact as a folder containing measure 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.