The output documents of the requirement survey must record atomic metrics and derived metrics. Therefore, you need to design metrics before designing tables at the data warehouse service (DWS) layer.

Notes for defining metrics

An atomic metric reflects clear statistical criteria and computational logic. An atomic metric is a measure in a business process. A derived metric is a common statistical metric. It is an atomic metric constrained by a time period and a modifier. You can create an atomic metric only after the relevant business process is defined. Before creating a derived metric, you need to know the specific report requirements. You must create an atomic metric before creating a relevant derived metric. Follow these limits and guidelines when defining metrics:
  • Atomic metrics, modifier types, and modifiers belong to the relevant business process. A modifier inherits the data domain of the corresponding modifier type.
  • A derived metric can contain multiple modifiers, which are determined by the semantics of the derived metric. For example, if the payment amount is an atomic metric, the transaction amount per customer, which is the payment amount divided by the number of buyers, is a derived metric.
  • A derived metric belongs to only one atomic metric and inherits the data domain of the atomic metric, but not the data domain of relevant modifiers.

Specify metrics based on business requirements

This tutorial assumes that users are marketing data analysts in the e-commerce marketing department. The required data includes the total sales of the kitchenware category of the last day in each province, the names of products whose sales rank top 10 in this category, and the purchasing power distribution (per capita consumption) of customers in each province. These types of data are used for marketing analysis.

According to previous analysis, the business process to be analyzed is receipt confirmation and the measure is the turnover of a product. Therefore, based on business requirements, an atomic metric can be defined: product turnover.

The derived metrics that can be defined are as follows:
  • Total sales of the kitchenware category of the last day in a province
  • Per capita consumption of the kitchenware category of the last day in a province, which is the total consumption divided by the number of customers
After sorting the total sales of the kitchenware category of the last day in a province in descending order, you can obtain the names of products whose sales rank top 10 in this category.