Define data standards before modeling or as business needs arise. Standards for lookup tables, measurement units, fields, and naming dictionaries ensure data consistency throughout modeling and application development, reducing downstream processing costs.
Supported data standards
DataWorks supports the following data standards: Field Standard, Lookup Table, Measurement Unit, and Naming Dictionary.
Field standards
A field standard normalizes a field's name, data type, and value range. Standardizing fields with the same meaning prevents confusion from naming or type variations. For example, a field standard named member_id ensures that all member ID fields across tables share a consistent definition.
|
Table name |
Original field |
Issue |
Standardized field |
|
Registration table |
user_id |
Inconsistent naming |
member_id |
|
Logon table |
userid |
No underscore, which can cause ambiguity |
Lookup tables
A lookup table defines the valid value range and allowed content for a field. For example, the values for a gender field can be restricted to Male, Female, and Unknown.
Measurement units
A measurement unit defines business-relevant units of measure, such as currency, object quantifiers, and time units. For example, the measurement unit for product quantity is pieces.
Naming dictionaries
A naming dictionary provides standardized translations for business terms, physical tables, and fields, including root words and morphemes. It serves as an enterprise-level library for naming conventions. For example, a company's annual revenue can be standardized as Annual Gross Revenue.
Data standard relationships
An association links a data standard to a specific field in a logical model. Once associated, the field must conform to the standard's rules.
Access the data standard page
-
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Modeling.
-
On the Data Modeling page, click Data Standard in the top menu bar to go to the data standard page.
Data standards: Field standards
A field standard defines a field's name, data type, and value range. You can associate fields that share the same meaning but have different names across tables. Modifying a field standard lets you quickly locate and update all associated tables.
Hierarchy
-
A field standard must be placed under the root directory, a directory, or a standard set. The hierarchy is as follows:
-
Root directory: The top-level directory. All other directories, standard sets, and standards must be placed in the root directory.
-
Directory: A folder used to store standards and standard sets, similar to a folder in an operating system.
-
Standard set: Similar to a directory, but can only contain standards.
-
-
Field standards can have inheritance relationships. For example, both buyer ID standards and seller ID standards can inherit from a member ID standard.
Define a field standard
If you need to enter a large number of field standards, you can use the batch import feature to work more efficiently.
-
In the left navigation bar of the Data Standard page, click Field Standard to go to the Field Standard page.
-
In the directory tree on the left, right-click the target directory or standard set and select Create Standard.
You can create directories or standard sets to organize your field standards as needed.
-
In the Create Standard dialog box, the key parameters are as follows.
Parameter
Description
Abbreviation
The name of the associated field in a logical model.
Display Name
The display name of the associated field in a logical model.
Length
A parameter related to the data type.
For example, if you select the DECIMAL data type, the length corresponds to 20 in DECIMAL(20,4).
Precision
A parameter related to the data type.
For example, if you select the DECIMAL data type, the precision corresponds to 4 in DECIMAL(20,4).
Not Null
Specifies whether a field referencing this standard can be null. Null values are allowed by default.
Default Value
The default value for the field if no value is provided. The value cannot exceed 2,048 characters in length.
Parent Standard
Select an existing standard as a parent to establish an inheritance relationship and better identify field associations.
For example, both buyer ID and seller ID are types of member ID. Therefore, the parent standard for both the buyer ID standard and seller ID standard is the member ID standard.
Referenced Lookup Table
Reference an existing lookup table to constrain the value range of a field. For more information, see Data standards: Lookup tables.
ImportantBefore you can delete a field standard, you must remove all of its references.
Use a field standard
Field standards can define specific fields in logical models, including source tables, dimension tables, fact tables, aggregate tables, and application tables. For example, in the dimension table for member information dim_ec_con_member_df, you can associate the member ID field with the field standard member_id. The field name is inherited from the abbreviation of the field standard, the display name from the display name, and properties such as Type and Not Empty are also inherited. For more information, see Configure dimension table fields.
Data standards: Lookup tables
A lookup table defines the valid value range and allowed content for a field.
Define a lookup table
If you need to enter a large number of lookup tables, you can use the batch import feature to work more efficiently.
-
In the left navigation pane on the Data Standard page, click Lookup Table to go to the Lookup Table page.
-
Right-click the created directory name, and click Create Lookup Table.
You can create directories to organize your lookup tables as needed.
-
In the Create Lookup Table dialog box, configure the following parameters and add enumerated values.
For example, set the ID to gender, the display name to Gender, and the name to gender. The enumerated values are shown in the following table.
Code value
Code name
Name
Description
0
Unknown
unknown
Gender not specified
1
Male
male
Male
2
Female
female
Female
ImportantBefore you can delete a lookup table, you must remove all of its references.
Publish a lookup table
On the lookup table details page, click Publish in the upper-right corner to materialize the lookup table as a physical table or materialized view.
Use a lookup table
Lookup tables can define specific fields in logical models, including source tables, dimension tables, and fact tables. For example, in the dimension table for member information dim_ec_con_member_df, you can associate the gender field with the lookup table gender. The field name is inherited from the ID of the lookup table, and the display name from the display name of the lookup table. For more information, see Configure dimension table fields.
Associating a lookup table automatically unifies field names across multiple tables.
|
Table name |
Original field |
Original enumerated values |
Standardized field |
Standardized enumerated values |
|
Member information table |
sex |
1, 2 |
gender |
0, 1, 2 |
|
Member logon table |
gender |
0, 1, 2 |
Apply standards based on lookup tables
When a logical model fact table or dimension table is published as a physical table, you can generate a quality rule for a field associated with a lookup table. This rule can be used to create a quality monitoring task that enforces the standard on the physical table. For more information, see Data labeling.
An example of a generated quality rule is as follows: The rule name is Field Rule-Lookup Table-(gender), the quality dimension is Consistency, the scope is Field-level(gender), and the rule template is Number of rows with mismatched enumerated values is 0. For the monitoring threshold, !=0 indicates an exception and =0 indicates normal. The severity is Weak Rule.
Data standards: Measurement units
Measurement units define business-relevant units of measure such as currency, object quantifiers, and time units.
Define a measurement unit
If you need to enter a large number of measurement units, you can use the batch import feature to work more efficiently.
-
On the Data Standard page, in the left navigation bar, click Measurement Unit to enter the Measurement Unit page.
-
On the Measurement Unit page, right-click the target measurement category, and select Create Measurement Unit.
The system provides you with Currency Unit, Object Quantifier, Ratio Unit, Ranking Unit, and Time Unit measure categories.
-
In the Create Measurement Unit dialog box that appears, configure the parameters to complete the setup.
For example, set the abbreviation to m, the name to meter, and the display name to Meter. For the category, select Object Quantifier.
Use a measurement unit
Associate with a logical model
Measurement units can define the unit of measure for a specific field in a logical model. This feature is supported for fact tables, aggregate tables, and application tables. For example, in the fact table for order creation dwd_trade_order, you can associate the Number of Products field with the measurement unit Pieces. For more information, see Configure fact table fields.
Associate with an atomic metric
When you define an atomic metric value, you can select an appropriate measurement unit based on the statistical data type of the atomic metric. For example, to count the number of product items, for Object Quantifier, you can select Item.
The available measurement units are categorized into currency units and object quantifiers. The object quantifiers category includes options such as households, families, and person-days. You can also configure other parameters such as Calculation Function, Decimal Places, and Enable Distinct.
Data standards: Naming dictionaries
A naming dictionary provides standardized translations for business terms, physical tables, and fields, including root words and morphemes. It serves as an enterprise-level library for naming conventions.
Define a naming dictionary
If you need to enter a large number of naming dictionary entries, you can use the batch import feature to work more efficiently.
-
On the Data Standard page, in the left navigation bar, click Naming Dictionary to go to the Naming Dictionary page.
-
Click Create. In the Create Naming Dictionary dialog box, configure the parameters and click OK.
For example, set the display name to Engine, the name to engine, and the abbreviation to eng..
Use a naming dictionary
A naming dictionary validates whether table names comply with naming conventions for data warehouse layers. This feature is supported for source tables, dimension tables, fact tables, aggregate tables, and application tables. For example, if no naming dictionary entry with the abbreviation trade exists, the table name dwd_trade_order does not comply with the DWD layer naming convention.
On the Checker Management page, click Add Rule. Select Table Name as the rule type. You can then define the rule by using the fixed text dwd and selections from the Root Word Abbreviation and Business Process Abbreviation dropdowns to match your naming convention.
To use this feature, you can configure it in the data warehouse layer checker. For more information, see Configure data warehouse layer checkers and Use checkers.
More operations
Batch import standards
For a large number of data standards, you can import them in batches. Download the import template provided by DataWorks, fill it in, and upload it.
-
On the Data Standard page, in the left navigation bar, click Naming Dictionary to go to the Naming Dictionary page.
The details pages for field standards and lookup tables also provide Import and Export buttons.
-
Click Import, and on the Import page, select the Import Type.
-
In the Template Preview section, click Download Template and fill in the required fields.
-
Click Next Step. On the Data Import tab, upload and preview the data file.
Note-
Import Mode: If an object with the same name as the imported file already exists in DataWorks, you can choose to skip the object or overwrite it with the content of the imported file.
-
Only files in the
.xlsxformat are supported for batch import. You can import up to 30,000 records at a time. The file size cannot exceed10 MB.
-
-
On the Complete tab, you can view the import result details. Click View More Details in the details list to go to the edit page, where you can perform additional operations. If the import status is Failed, you need to resolve the error based on the error details and re-import the data.
Batch export standards
To reuse data standards across workspaces, export them in batches from the details pages for field standards, lookup tables, or naming dictionaries.