Build Your First Metric
In this guide, we will walk through the process of creating a business metric from raw data. We assume you have already ingested data into a Topic (e.g., order).
Goal: Create a "Total Revenue" metric to track sales performance.
Step 1: Create a Semantic Model​
Before defining a metric, we must map the raw data topic to a business entity.
- Navigate to Metrics Platform > Semantic Model.
- Click Create Model.
- Basic Info:
- Name:
Sales Model - Source Topic: Select your datamart topic (e.g.,
order).
- Name:
- Define Measures:
- Find the field representing the amount (e.g.,
order_amount). - Click Add to Measures.
- Rename it to
Revenue(Business friendly name).
- Find the field representing the amount (e.g.,
- Define Time Dimension:
- Find the transaction date (e.g.,
order_date). - Mark it as the Time Dimension.
- Find the transaction date (e.g.,
- Click Save.
Why? This decouples your metrics from cryptic database column names.
Step 2: Define the Metric​
Now we create the standardized KPI.
- Navigate to Metrics Management.
- Click New Metric.
- Configuration:
- Name:
Total Revenue - Semantic Model: Select
Sales Model. - Measure: Select
Revenue. - Aggregation:
Sum. - Format:
Currency(e.g.,$).
- Name:
- Click Save.
You now have a governed metric that can be reused across the organization.
Step 3: Visualize and Analyze​
Finally, let's use the metric.
- Navigate to Metrics Analysis.
- Create a New Dashboard.
- Add Card:
- Select
Total Revenuefrom the library. - The system immediately shows the total number.
- Select
- Break Down:
- Drag a dimension (e.g.,
RegionorProduct Type) to the Breakdown area. - The chart automatically updates (e.g., to a Bar Chart or Line Chart).
- Drag a dimension (e.g.,
- Save your dashboard.