Getting Started Example
Overview
Through this case, quickly experience the entire process from metric definition to analysis. This case will create the following sales-related metrics based on the order table and present visualization effects on the data analysis card to analyze the sales profitability of each province.
| Metric Name | Metric Type | Calculation Method | Business Caliber |
|---|---|---|---|
| Total Cost Price | Atomic Metric | sum(Order Table Cost Price) | Valid total cost amount |
| Total Sales Amount | Atomic Metric | sum(Order Table Sales Amount) | Valid total sales amount |
| Sales Gross Profit | Composite Metric | Total Sales Amount - Total Cost Price | Sales Gross Profit = Sales Amount - Cost Price |
| Sales Gross Profit YoY | Derived Metric | YoY/MoM - Annual MoM - Growth Rate | Sales Gross Profit YoY ratio |
Operation Steps
Step 1: Integrate Dataset
In the Data Preparation module of Guandata BI, integrate the dataset needed for creating metrics. This example uses local Excel file import. For specific operations, see Local Files
Original data table: Visualization Chart Practice Data

Step 2: Create Public Dimensions
Go to Metric Center > Public Dimensions, create a public dimension named Province, and associate the Province fields from the datasets used in this example. These fields will then appear consistently as Province across metrics.


Step 3: Create Metrics
Create Metric Topic and Folder
Go to Metric Center > Metric Topic, create Sales Status Statistics Topic, and create a Profit Status folder within it to manage the metrics in this example.


Create Atomic Metrics
Go to Metric Center > Metric Management, select Sales Status Statistics Topic, click Add Metric, and select Atomic metric.


Create the first metric "Total Cost Price". Complete the configuration, then save and publish the metric. The configuration items are as follows:
- Dataset: Select the required Order Table
- Source Field: Select Cost Price
- Calculation Method: Select Sum
- Data Format: Select Currency
- Applicable Dimensions: Select as needed, recommended to select Date and Province
- Filter Condition: To ensure the metric data is valid and can guide future business strategies, configure the condition as Cost Price > 0 and Inventory Status != 0
- Business Caliber: Valid total cost amount
- Save to: Profit Status folder
Create the second metric "Total Sales Amount". Complete the configuration, then save and publish the metric. The configuration items are as follows:
- Dataset: Select the required Order Table
- Source Field: Select Sales Amount
- Calculation Method: Select Sum
- Data Format: Select Currency
- Applicable Dimensions: Select as needed, recommended to select Date and Province
- Filter Condition: To ensure the metric data is valid and can guide future business strategies, configure the condition as Cost Price > 0 and Inventory Status != 0
- Business Caliber: Valid total sales amount
- Save to: Profit Status folder
Create Composite Metric
Go to Metric Center > Metric Management, select Sales Status Statistics Topic, click Add Metric, and select Composite metric.


Create the third metric "Sales Gross Profit". Complete the configuration, then save and publish the metric. The configuration items are as follows:
- Calculation Formula: Total Sales Amount - Total Cost Price
- Data Format: Select Currency
- Applicable Dimensions: Select Use common dimensions of metrics in the expression to use the dimensions shared by Total Sales Amount and Total Cost Price
- Business Caliber: Sales Gross Profit = Sales Amount - Cost Price
- Save to: Profit Status folder

Create Derived Metric
Go to Metric Center > Metric Management, select Sales Status Statistics Topic, click Add Metric, and select Derived metric.

Create the fourth metric "Sales Gross Profit YoY". Complete the configuration, then save and publish the metric. The configuration items are as follows:
- Derived From: Select metric Sales Gross Profit
- Applicable Dimensions: Inherited from source metrics, cannot be modified
- Time Dimension: Inherited from source metrics, cannot be modified
- Derived Type: YoY/MoM
- Time Granularity: Year
- Default Current Period Time Range: This year
- Comparison Type: YoY/MoM - Annual MoM
- Value Setting: Growth Rate; Calculation Method: (Current Period Data - Previous Period Data) / abs(Previous Period Data) * 100%
- Data Format: Percentage
- Business Caliber: Sales Gross Profit YoY ratio
- Save to: Profit Status folder
Step 4: Create Metric Analysis Card
Enter the Data Analysis module, create a new page and click New Card to create a metric analysis card.

Create the first metric analysis card, using a table format to comprehensively display the data of Total Cost Price, Total Sales Amount, and Sales Gross Profit for each province.
- Visualization Method: Select Table
- Metric: Select Total Cost Price, Total Sales Amount, and Sales Gross Profit
- Dimension Selection: Province
Create the second metric analysis card, using a single line chart to show the monthly profit trend in Zhejiang Province.
- Visualization Method: Single Line Chart
- Metric: Select Sales Gross Profit
- Dimension Selection: Select Date (Month)
- Filter: Select Province and select Zhejiang Province
Drag and layout the created cards in the dashboard. The cards can also be applied to mobile applications and large screens later. The usage method is the same as other BI visualization analysis cards, which will not be expanded here.