tencent cloud

Business Intelligence

Product Introduction
Product Overview
Strengths
Product Features
Use Cases
Purchase Guide
Billing Instructions
Purchase Guide
Upgrade Instructions
Renewal Instructions
Quick Start
Data Access
Creating a VPC Data Source
Creating Cloud Data Sources
Creating Proprietary Data Sources
Data Table Creation and Data Processing
Introduction to Data Analysis Basics
Data Table Creation
Data Processing
Data Analysis
Analysis Settings
Interactive Analysis
Ad-Hoc Analysis
Data Visualization
Public Style Setting Instructions
Filter Components
Chart components
Rich Text Component
Other Components
Mobile Terminal Layout Editor
Theme Settings Introduction
Page Layout Introduction
Dashboard Directory Management
Collaboration and Application
Push Channel Management
Report Push
Sharing
Embedding
Self-Service Data Retrieval
Metric Alarms
Data Security
Parameter Construction
Platform Management
Account and Permission Management
Statistics and Analysis
System Settings
Resource Migration
Practical Tutorial
Collection of Optimization Practices
Performing Trend Analysis
Performing Proportion Analysis
Performing Data Analysis with Excel Files
Creating Tables
API Documentation
History
Introduction
API Category
Making API Requests
Project Management APIs
Role APIs
Database Table APIs
Report Embedding APIs
Page Management APIs
Data Types
Error Codes
FAQs
Relevant Agreements
Service Level Agreement
Privacy Policy
Data Privacy And Security Agreement
Contact Us

Calculated Fields

PDF
Focus Mode
Font Size
Last updated: 2025-09-19 15:14:19
Business Intelligence (BI) supports configuring calculated fields using custom SQL functions to meet flexible querying needs. The specific operation steps and process are shown below.

Adding Calculated Fields

In the Data Table module under Data, click "View" for the data table that requires a new calculated field:


Then, in the interface for viewing the data table details, click Add New Calculated Field in the upper-left corner:


Complete the configuration information for the added calculated field:
Field name: Enter the name of the calculated field.
Field type: The available types are "numeric value", "text", and "time".
Calculation rule: Enter a field expression, support functions and arithmetic operations, click on the right to quickly refer to functions and fields


Descriptions of Commonly Used Functions

The commonly used functions and their usage instructions are provided below. Additionally, if a data table is generated from the connected database, all SQL query functions in the database can be used in the calculation rule for an added calculated field.
SUM([field name]): Sum the metric values.
COUNT([field name]): Count the field values.
COUNT(DISTINCT[field name]): Count the field values after deduplication.
AVG([field name]): Calculate the mean of the metric values.
CASE WHEN: For example, CASE WHEN [condition 1] THEN [result 1] WHEN [condition 2] THEN [result 2] ELSE [other result] END assigns different result values based on different conditions.
Note:
Note: After configuring and saving the calculated field information, you can preview the newly-added calculated field in the data table detail view interface. If the calculated field involves aggregate function calculations such as sum(), count(), or avg(), the data cannot be directly previewed and will display as "-". You need to configure chart dimensions/metrics on the report page to perform aggregation and display the results.

Descriptions of Calculated Field Nesting Support

When you add a calculated field, if the current data table already has available calculated fields, the available fields will appear under "Existing Fields". At this point, you can reference the existing fields to nest calculated fields. For example, in a data table that records product sales performance, "Sales Revenue" is a calculated field, and the calculation logic is as follows: Quantity × Price. Assuming each product has a fixed cost of 100 CNY, if you want to calculate the profit, you need to subtract 100 from the sales revenue. In this case, when creating the "Profit" calculated field, you can reference the existing "Sales Revenue" field.
A maximum of 4 nested levels is supported for calculated fields. If the number of nested levels exceeds 4, when you click "Confirm" in the pop-up window for creating a calculated field, the system will prompt you with "The nested level of calculated fields cannot exceed 4". Additionally, loop nesting is not allowed. For example, if A, B, and C are calculated fields, and B references A while C references B, then you cannot reference B, C, or A itself when modifying the logic of A, as this would create loop nesting.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback