Use Case 5: Add a Degen Custom Fact
You can add a degenerate (degen) custom fact containing both aggregable metrics and descriptive attributes and join the degen custom fact to a prebuilt dimension with a defined key.
The prebuilt SCM – Sales Order subject area doesn’t contain the required Fact – Holiday Calendar metrics and Dim – Fact – Holiday Calendar – degendim attributes. In this use case, you add the Fact – Holiday Calendar and Dim – Fact – Holiday Calendar – degendim folders to the SCM – Sales Orders prebuilt subject area. The Fact – Holiday Calendar folder contains aggregable metrics. The Dim – Fact – Holiday Calendar – degendim folder contains descriptive attributes. The degen custom fact is joined to the prebuilt Dim – Data Gregorian Calendar using the Date key.
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.
- SCM – Sales Orders prebuilt subject area
- 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 holiday dimension table, FDI_X_HOLIDAY_CALENDAR_D, in the autonomous data warehouse associated with your Fusion Data Intelligence instance using the sample files FDI_X_HOLIDAY_CALENDAR_D.xls or FDI_X_HOLIDAY_CALENDAR_D.sql.
- Create the sample dimension view FDI_X_HOLIDAY_CALENDAR_F_V using
this SQL
script:
CREATE OR REPLACE FORCE EDITIONABLE VIEW "OAX_USER"."FDI_X_HOLIDAY_CALENDAR_F_V" ("CALENDAR_DATE", "HOLIDAY", "BUSINESS_DAY", "TODATE_BUSINESS_DAYS", "MONTH_BUSINESS_DAYS") DEFAULT COLLATION "USING_NLS_COMP" AS ( SELECT CALENDAR_DATE, HOLIDAY, BUSINESS_DAY, SUM(BUSINESS_DAY) OVER (PARTITION BY TO_CHAR(CALENDAR_DATE,'MM-YYYY') ORDER BY CALENDAR_DATE) AS TODATE_BUSINESS_DAYS, SUM(BUSINESS_DAY) OVER (PARTITION BY TO_CHAR(CALENDAR_DATE,'MM-YYYY')) AS MONTH_BUSINESS_DAYS FROM ( SELECT d.CALENDAR_DATE, d.DAY_LOCALE_NAME, c.HOLIDAY, CASE WHEN DAY_LOCALE_NAME NOT IN ('Saturday','Sunday') AND HOLIDAY IS NULL THEN 1 ELSE 0 END AS BUSINESS_DAY FROM DW_DAY_D d LEFT JOIN FDI_X_HOLIDAY_CALENDAR_D c ON c.COL_DATE = d.CALENDAR_DATE ) );
- Grant semantic model access to the FDI_X_HOLIDAY_CALENDAR_F_V view
for the OAX$OAC schema using the following SQL
script:
GRANT SELECT ON "OAX_USER"."FDI_X_HOLIDAY_CALENDAR_F_V" TO "OAX$OAC";
- Validate that the data is loading from the sample as expected using
the following SQL
script:
SELECT * FROM FDI_X_HOLIDAY_CALENDAR_F_V WHERE HOLIDAY IS NOT NULL;
Add Fact with Degen Attributes to the Semantic Model
You create a logical star to define the autonomous data warehouse object, degen attributes, fact measures, display labels, keys, aggregation rules, and content levels.
Join Custom Fact with Degen Attributes to a Prebuilt Dimension
You add prebuilt dimensions and join them to the custom degen fact using foreign keys defined in the custom degen fact.
Present the Custom Fact with the Degen Attributes in the Semantic Model
You modify the subject area to present the new custom degen fact and its aggregable metrics, along with the degen dimension and its attributes. The system presents the degen fact as a folder containing the measure columns and the degen dimension as a separate folder containing the attribute columns.
In this step, you modify the SCM – Sales Order subject area to present the new degen fact folder Fact – Holiday Calendar containing three measures, Business Day, Month Business Days, and Todate Business Days, along with the new degen dim folder Dim – Fact – Holiday Calendar – degendim containing the Holiday attribute.
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.