Creating Fact Tables

A fact table for a business process can provide a wealth of information about specific business processes. After a fact table is created, the public affair details are accumulated to facilitate data extraction.

Creating and Publishing a Fact Table

  1. Log in to the DGC console, select a DGC instance, and click Access.

    On the displayed page, click the Workspaces tab. In the workspace list, locate the required workspace.

  2. Click Data Design of the corresponding workspace to access the Data Design console.
  3. Choose Dimensional Modeling from the left navigation bar. On the displayed page, click the Fact Tables tab.
  4. Select a subject from the subject tree on the left and click Create.
  5. On the Create Fact Table page, perform the following operations:
    1. Set the parameters in the Basic Configuration area.
      Figure 1 Basic Configuration area
      Table 1 Parameters of the Basic Configuration area

      Parameter

      Description

      Subject

      Click Select to select a subject catalog (subject area group > subject area > business object) where you can place the fact table.

      Name

      Table names must start with letters. Only letters, digits, and underscores (_) are allowed.

      Code

      Table codes must start with letters. Only letters, digits, and underscores (_) are allowed.

      Data Connection Type

      Select a data connection type from the drop-down list.

      Data Connection

      Select a data connection from the drop-down list. It is recommended that a same data connection be used for dimension modeling.

      Database

      Select a database from the drop-down list.

      Queue

      DLI queue. This parameter is displayed only for DLI data connections.

      Schema

      This parameter is displayed only for DWS data connections.

      Table Type

      This parameter is displayed only for DWS data connections. The options are:

      • DWS_ROW indicates that tables are stored to disk partitions by row.
      • DWS_COLUMN indicates that tables are stored to disk partitions by column.

      DISTRIBUTE BY

      This optional parameter is valid only for the DWS connection type. You need to add a table field before selecting a table field from the drop-down list as the DISTRIBUTE BY field.

      Currently, only REPLICATION and HASH are supported.

      • REPLICATION: A full table is stored on each DN. The advantage of this option is that each DN has all the data of a table. During the join operation, data redistribution can be avoided, reducing network overhead. The disadvantage is that each DN retains the complete data of a table, resulting in data redundancy. Generally, this option is recommended for small dimension tables.
      • HASH: If you select this option, you need to specify a distribution key for the user table. When a record is inserted, the system performs hash computing based on values in the distribute keys and then stores data on the corresponding DN. In a Hash table, I/O resources on each node can be used during data read/write, which improves the read/write speed of a table. Generally, this option is recommended for large dimension tables (a large dimension table contains over 1 million records).

      Owner

      Select an asset owner from the drop-down list. Only the workspace administrator or developer can be set as the owner.

      Description

      A description of the fact table. Up to 600 characters are supported.

    2. In the Field Configuration area, click Create to select one or more created dimensions. The primary key fields of the dimensions are then added to the list.

      Click the Up or Down icon to adjust the rankings of dimensions.

      Figure 2 Dimension Configuration area
      Table 2 Parameters of the Dimension Configuration area

      Parameter

      Description

      Field Name

      The primary key name of the added dimension is displayed automatically. Generally, you do not need to change the name.

      Field names must start with letters. Only letters, digits, and underscores (_) are allowed.

      Field Code

      The primary key code of the added dimension is displayed automatically. Generally, you do not need to change the code.

      Field codes must start with letters. Only letters, digits, and underscores (_) are allowed.

      Data Type

      The data type of the created dimension.

      Primary Key

      If this parameter is selected, the field is a primary key.

      Partition

      If this parameter is selected, the field is a partition field.

      Not Null

      Whether the parameter value can be left empty.

      Associating with Data Standards

      If you have created data standards, click to select one to associate with the field. Choose Configuration Center > Function Configuration and select Create Quality Jobs. Associate fields with a data standard. After a table is published, a quality job is automatically generated. A quality rule is generated for each field associated with the data standard. The quality of the field is monitored based on the data standard. You can go to the Quality Job page of the DGC Data Quality Control to view the job details.

      If you have not created a data standard, create one. See Data Standards for details.

      Associated Dimension

      The name of the associated dimension. Click to replace the associated dimension.

      Role

      If a dimension is added multiple times, you need to set different roles to distinguish the dimensions. See Figure 2.

      Description

      A description of the dimension.

    3. In the Field Configuration area, click Create to add a measurement.
      Figure 3 Configuring a measurement
      Table 3 Parameters of configuring a measurement

      Parameter

      Description

      Field Name

      Field names must start with letters. Only letters, digits, and underscores (_) are allowed.

      Field Code

      Field codes must start with letters. Only letters, digits, and underscores (_) are allowed.

      Data Type

      Field data type. If the required data type does not exist, you can add one. See Managing a Field Type.

      Associating with Data Standards

      If you have created data standards, click to select one to associate with the field. Choose Configuration Center > Function Configuration and select Create Quality Jobs. Associate fields with a data standard. After a table is published, a quality job is automatically generated. A quality rule is generated for each field associated with the data standard. The quality of the field is monitored based on the data standard. You can go to the Quality Job page of the DGC Data Quality Control to view the job details.

      If you have not created a data standard, create one. See Data Standards for details.

      Associated Dimension

      The name of the associated dimension. Click to replace the associated dimension.

      Description

      A description of the measurement.

  6. Click Save and Publish to apply for approval.
  7. Wait for the reviewer to approve the fact table.

    After the fact table is approved, it is automatically created in the database.

  8. Go back to the fact table list and locate the table just published. View its synchronization status in the Sync Status column.
    • If the synchronization is successful, the fact table is successfully published and created in the database.
    • If the synchronization failed, choose More > View Publish History in the row where the fact table is located. On the displayed page, click the Publish Log tab to view logs. Troubleshoot the problem based on the logs. After the error is rectified, choose More > Synchronize above the fact table list to issue the synchronization command again. If the problem persists, contact technical support personnel.

Managing a Fact Table

After a fact table is created, you can access the Fact Tables page of Dimensional Modeling in Data Design. On the displayed page, you can edit, publish, suspend, and delete the fact table, as well as view the publish logs.

Figure 4 Fact table management
  • Editing a fact table
    1. In the fact table list, select a fact table you want to edit and click Edit to the right of it. The page for editing the fact table is displayed.
    2. Edit the table as required.
    3. Click Save to save the settings, or click Save and Publish to publish the settings.
  • Publishing a fact table
    1. In the fact table list, select the fact tables you want to publish and click Publish. The dialog box for publishing fact tables is displayed.
    2. Select a reviewer from the drop-down list.
    3. Click Confirm.
  • Viewing the publish history
    1. Select a fact table in the list and choose More > View Publish History on the right.
    2. On the displayed page, you can view the publish history and version comparison information of the fact table.

      If the publish log includes error logs, the publishing has failed. You can click Resynchronize to synchronize the table to other modules of DGC.

  • Associate a fact table with a quality rule.
    1. In the fact table list, select the fact table you want to associate with a quality rule and click Associate Rule above the fact table list. The Associate Quality Rule dialog box is displayed.
    2. In the Associate Quality Rule dialog box, you can add rules to the fields in the fact table in batches and associate the rules with the fields.
    3. Click OK.
  • Previewing a SQL statement
    1. Select a fact table in the list and choose More > Preview SQL on the right.
    2. On the displayed page, you can view or copy the SQL statement.
  • Suspending a fact table
    1. In the fact table list, select the fact tables you want to suspend and click Suspend. The dialog box for suspending fact tables is displayed.
    2. Select a reviewer from the drop-down list.
    3. Click Confirm.
      • The prerequisite for suspending or deleting a fact table is that the fact table is not referenced to define atomic metrics.
  • Deleting a fact table

    If you no longer need a fact table, you can delete it. Fact tables that are to be published, already published, or to be suspended cannot be deleted.

    1. In the fact table list, select the fact tables you want to delete and choose More > Delete above the list. The dialog box for deleting fact tables is displayed.
    2. Click OK.

Associating a Fact Table with a Quality Rule

  1. On the Data Design console, choose Dimensional Modeling from the left navigation bar.
  2. Click the Fact Tables tab. The Fact Tables tab is displayed.
  3. In the fact table list, click the name of the fact table you want to associate with a quality rule. Click Associate Rule.
    Figure 5 Associating with a quality rule
  4. On the displayed page, set parameters as prompt. After the configuration is completed, click OK.
    Figure 6 Associating a fact table with a quality rule

    Generate Anomaly Data: If this option is selected, anomaly data is stored in the specified database based on the configured parameters.

Creating a Field in the Fact Table

  1. On the Data Design console, choose Dimensional Modeling from the left navigation bar.
  2. Click the Fact Tables tab. The Fact Tables tab is displayed.
  3. In the fact table list, click the name of the table for which you want to create a field and click Edit in the Operation column. The editing page is displayed.
  4. Click Create in the Field Configuration area, select a new field type from the drop-down list, and set related parameters.
    Figure 7 Creating a field
  5. After the configuration is complete, click OK.

Associating a Fact Table Field with a Data Standard

  1. On the Data Design console, choose Dimensional Modeling from the left navigation bar.
  2. Click the Fact Tables tab. The Fact Tables tab is displayed.
  3. In the fact table list, click the name of the fact table you want to associate with a data standard.
  4. In the table field list on the details page of the fact table, search for the field you want to associate with a data standard, click corresponding to the field to configure the association between the field and the data standard. For details on the sources of data standards, see Creating a Data Standard.
    Figure 8 Associating a fact table field with a data standard
  5. After the configuration is complete, click OK.

AssociatIng a Fact Table Field with a Quality Rule

  1. On the Data Design console, choose Dimensional Modeling from the left navigation bar.
  2. Click the Fact Tables tab. The Fact Tables tab is displayed.
  3. In the fact table list, click the name of the fact table you want to associate with a quality rule.
  4. In the table field list on the details page of the fact table, locate the target field and click to associate the field with a quality rule.
    Figure 9 Associating a single table field with a quality rule
  5. After the configuration is complete, click OK.
    Figure 10 Adding rules

AssociatIng Fact Table Fields with Quality Rules in Batches

  1. On the Data Design console, choose Dimensional Modeling from the left navigation bar.
  2. Click the Fact Tables tab. The Fact Tables tab is displayed.
  3. In the fact table list, click the name of the fact table you want to associate with a quality rule.
  4. In the table field list on the details page of the fact table, select the table fields you want to associate with quality rules and click Associate Rule.
    Figure 11 Associating fact table fields with quality rules
  5. On the page that is displayed, add rules and set rule parameters.
    Figure 12 Adding rules
  6. After the configuration is complete, click OK.