← Back to Technical blog

Technical article

Turning Business Definitions into Executable Assets: How the HENGSHI Metric Semantic Layer Supports AI Analysis

Use atomic metrics, business metrics, shared granularity, and dataset knowledge to align calculations, time, and analytical scope for dashboards and AI analysis.

Nov 16, 2026Technical blogHENGSHI12 min read
Agentic BIHENGSHI SENSE

Article body

Full article

The same question, “What is this month’s revenue?”, may mean recognized revenue to finance, signed contract value to sales, and cash receipts to operations. A different amount field, time axis, or refund rule can make conversational answers and dashboards impossible to compare directly. Enterprises must define these differences before letting different roles and AI analysis reuse the appropriate definitions.

HENGSHI SENSE supports calculation logic through atomic metrics, business metrics, and HQL, uses shared metric granularity to align dimensions, time axes, and qualifying conditions, and adds terminology and field mappings through dataset knowledge. Data Agent can use prepared metrics and knowledge to understand questions and query data; dashboards can reuse corresponding metrics. Teams can maintain calculations and analytical conditions centrally and validate affected scenarios after models or business rules change.

Founded in 2016 for the Data+AI era, HENGSHI has pioneered a new generation of Agentic BI. Its enterprise analytics platform, HENGSHI SENSE, works with the HENGSHI JARVIS digital employee, the HENGSHI CLI execution engine, and HENGSHI BOX, a privately deployed control hub, to form an integrated service portfolio. With a decade of BI expertise and its “Powered by Hengshi” ecosystem strategy, HENGSHI empowers software vendors across industries and provides enterprise groups in manufacturing, finance, retail, government, and other sectors with integrated AI analytics for business management and intelligent decisions, built on trusted data within their private environments.

1. Establish the data grain before defining metrics

A metric semantic layer cannot replace correct data relationships. One order-table row represents an order, one payment-table row represents a payment, and one order-line row represents a product. Joining these tables and summing order amounts directly can count an order multiple times. The formula may look correct while the result is wrong.

Before creating metrics in HENGSHI, confirm the primary dataset and relationship model: each table’s business grain, uniqueness of join keys, any one-to-many expansion, and the business event represented by each time field. Validate these conditions before defining aggregate expressions and analysis dimensions.

Field names explain what something is, model relationships explain how data connects, metric definitions explain how to calculate, and business configuration explains the scope of analysis.

2. Connect calculations to analytical scenarios with atomic and business metrics

HENGSHI distinguishes atomic metrics and business metrics. Atomic metrics contain metric definitions. Business metrics add business information such as qualifying conditions, analysis dimensions, and a time axis. Definitions use aggregate expressions and can combine HQL, fields, parameters, and user attributes to express business calculations.

Asset layerWhat it containsQuestions to confirm
Datasets and modelsFields, relationships, and accessible data scopeWhat are the respective grains of orders, payments, and product lines?
Atomic metricsName, description, aggregate expression, and display formatDoes revenue include tax? How are refunds and nulls handled?
Business metricsMetric definitions plus qualifying conditions, dimensions, time axis, and other business configurationIs reporting by payment month or order month? Which dimensions are available?
Shared metric granularityDimension lists, time axis, and qualifying conditions reused by multiple metricsDo revenue and transaction count follow the same analytical conditions?
Dataset knowledgeBusiness background, terminology, field mappings, and implicit conditionsWhich field or metric represents “cash collection”? Which wording needs clarification?

Ratios, year-over-year changes, and period-over-period changes can be built with expressions and metric combinations. They need not be described as product categories separate from atomic and business metrics. Preview and check complex calculations before deploying reusable definitions.

3. Use shared granularity to align analytical conditions across metrics

A business dashboard often displays revenue, order count, and profit together. If each has separate dimensions, time axes, and filters, maintenance can easily change only one. HENGSHI’s metric granularity centrally manages the dimension list, time axis, and qualifying conditions that business metrics can reference.

Once granularity is referenced, its business configuration synchronizes to the metric and cannot be edited separately on the metric page. Changes to granularity synchronize the corresponding configuration to referencing metrics. This lets metrics in the same business scenario share analytical boundaries without repeated configuration. The synchronization covers shared granularity configuration; it does not automatically migrate every report, knowledge description, or external system.

For example, shared granularity for daily store operations can include store, category, and payment-date dimensions, use payment date as the time axis, and add enterprise-approved valid-transaction conditions. Revenue and transaction-count business metrics that fit this definition can reference it, after which teams check their expressions and data previews.

HENGSHI granularity can also use fields from related datasets in the current model and records each field’s dataset. Two tables with a “region” field do not necessarily mean the same thing. Recheck references after model relationships or field visibility change. Invalid fields must be selected again; the system should not be expected to rebind them to another same-named field automatically.

4. Define ratios and time precisely to avoid correct numbers with the wrong meaning

Aggregation often hides the hardest semantic issues. The hypothetical example below uses amounts in the same unit to distinguish overall gross margin from an average of store margins.

StoreRevenueGross profitStore gross margin
A1003030%
B9009010%
Total1,000120Overall gross margin: 12%

Overall gross margin is total gross profit divided by total revenue, or 120 ÷ 1,000 = 12%. Averaging 30% and 10% produces 20%, which answers a different question. Encode the intended algorithm in the metric definition and validate aggregation across dimensions with sample data. A model cannot determine the enterprise’s intended definition from the name “gross margin” alone.

Time needs an explicit definition too. “This month’s sales” may use order, payment, or revenue-recognition dates. Refunds may reverse the original order period or enter the period when the refund occurs. A HENGSHI business metric selects its time axis from date dimensions; when several exist, only one is selected as the time axis. Questions requiring another time basis need an appropriate metric or an explicit change in analytical conditions.

Definitions must appear in both calculation and explanation: expressions execute them, while descriptions and dataset knowledge explain them. Adding “use the finance definition” cannot replace configuring the actual amount field, filters, and time axis.

5. Organize metrics and permissions for analytical use

As metrics increase, users need a way to find the right definition. HENGSHI supports organizing metrics by subject area and managing publication, withdrawal, and access grants. Published metrics associated with a subject area can appear in the metric marketplace. Metric details expose definitions, granularity, and upstream and downstream lineage to support understanding and reuse.

Finding a metric and having permission to query its data are separate matters. Dataset knowledge cannot grant access, and a natural-language claim such as “I am a regional manager” cannot determine authorization. Analysis should execute under the actual signed-in identity and configured resource and data permissions. Business filters express analytical conditions and cannot substitute for authorization.

Before Data Agent use, teams can add dataset purposes, field descriptions, synonyms, and implicit conditions. For example, connect “cash collection” to the enterprise’s cash-receipts metric and define “active stores” through explicit business conditions. Knowledge helps interpretation; metrics and permissions constrain the calculation itself.

6. Hypothetical design: validate semantic coverage with real business questions

A hypothetical retail chain preparing conversational business analytics can start with the questions regional managers ask every week rather than attempting to cover every field. For questions such as “How is revenue changing?”, “Which stores contribute most?”, and “Has the profit structure changed?”, confirm metrics, granularity, time axes, and visible scope individually.

  1. Build a minimum useful metric set. Confirm cash revenue, transaction count, and gross profit definitions; handle payment-to-order-line relationships; and validate against manually calculated samples.
  2. Reuse granularity and add knowledge. Configure shared granularity for metrics suited to joint analysis and explain terms such as cash collection and comparable stores. Preserve separate definitions for metrics needing different reporting scopes.
  3. Accept through a question matrix. Test overall queries, store drill-downs, cross-period comparisons, ambiguous questions, and unauthorized access. Record which questions can be answered directly, need clarification, lack data, or need new metrics.
  4. Turn frequent gaps into assets. Create reusable metrics for recurring, business-approved calculations, clarify ambiguous terms through knowledge, and address missing source data in data preparation. Avoid creating a metric for every temporary wording.

Metric changes after launch also need validation. HENGSHI provides lineage and some reference checks to help identify dependencies; enterprises must still inspect related charts, conversational scenarios, and external calls. Shared granularity synchronization reduces repeated configuration, while business acceptance verifies changed results still meet users’ needs.

HENGSHI connects metric calculations, business granularity, subject areas, knowledge descriptions, and analytical use. Enterprises can start with frequent questions and expand verifiable semantic coverage so dashboards and AI analysis continue to reuse confirmed business definitions.

HENGSHI SENSE

Resources, ecosystem, and implementation stories

Explore how teams design and ship analytics with HENGSHI.

Request a trial

Enterprise deployment, embedded delivery, and trial requests can all be handled quickly.