Skip to main content

Building BI Analysis Reports from Scratch

In the digital era, intelligent analysis of sales data is becoming a crucial tool for enterprise decision-making. This tutorial uses the coffee category sales data of a fast-moving consumer goods company as an example to guide you through quickly building a natural language-driven intelligent sales analysis report, achieving a fully automated analysis process from data to insights.

You only need to input a natural language sentence, such as "Analyze the coffee sales trend of each store last quarter." The system will automatically recognize the business intent, optimize and generate SQL query statements, extract the required information from the data source, and automatically generate chart reports. Whether it is sales comparison of different flavors, sales heatmaps across regions, or promotional activity effect analysis, all can be completed with one click.

The generated reports support style customization, flexible switching of chart types, and can enable AI insight features to help you automatically identify key factors behind sales fluctuations, timely discover growth opportunities or potential issues.

This tutorial is suitable for data analysis beginners, business managers, and enterprise users who want to quickly validate sales strategies. It is an ideal starting point for building practical and intelligent sales analysis reports.

Coffee Sales Data Preparation

Before building the report, you need to prepare the coffee sales data. In this tutorial, we use the coffee category sales data from a fast-moving consumer goods company's daily sales, stored in a SQL Server database, mainly containing two tables:

  • coffee_sales
  • coffee_sales_0613

Importing sales data into the database is a prerequisite for the system to recognize and analyze the data. Besides SQL Server, you can also choose to store data in other compatible data platforms such as: MySQL, Azure Databricks

After data import is complete, you need to obtain the database connection information, including:

  • Host (database address)
  • Port (port number)
  • Username
  • Password
  • Database name

This information will be used later when adding the data source.

Adding Coffee Sales Data as a Data Source

Next, we need to add the coffee sales data tables from the database as system-recognizable data sources. The steps are as follows:

  1. Enter the Data module in the system.
  2. Click "Data Sources" in the left menu bar.
  3. On the data source page, click the "Add Data Source" button at the top right.
  4. On the "Create Data Source" page, fill in the following information:
    • Data Source Name: coffee
    • Data Source Description: sales data for coffee
    • Database Type: select SQL Server
    • Host: enter the database address
    • Port: enter the port number
    • Username / Password: enter the authentication information required for connection
    • Database Name: enter the database name where the sales data is stored
  5. Click "Test Connection" below to verify if the information is correct.
  6. After the test passes, click "Confirm" to complete adding the data source.

At this point, the system has successfully established a connection with the database.

Selecting Coffee Sales Data Tables

After creating the data source, you also need to specify the actual tables to be used:

  1. Return to the data source list and click the newly created coffee data source.
  2. On the data source details page, select the following two tables as analysis targets:
    • coffee_sales
    • coffee_sales_0613
  3. Select and confirm adding them. This step ensures the system has correctly read and loaded the coffee sales data.

At this point, the coffee sales data has been officially connected to the system as a data source, ready for the next step of intelligent analysis construction.

Synchronizing Coffee Sales Data to the Data Catalog

Although we have successfully added the coffee sales data tables as data sources earlier, the system still cannot view the field structures of these two tables, nor does it have any business semantic descriptions of the fields. Therefore, the next step is to synchronize the table structures in the data catalog and supplement field information to improve the readability and accuracy of subsequent data analysis.

Synchronization Steps

  1. Enter the Data module in the system.
  2. Click "Data Catalog" in the left menu bar.
  3. Under "Belonging Data Source" on the page, find the data source coffee just added.
  4. The system will display the two tables under this data source on the right:
    • coffee_sales
    • coffee_sales_0613
  5. Click to enter the second table coffee_sales.

  1. On the table details page, click the "Synchronize" button at the top right:
    • The system will automatically pull and display the field structure of the table from the database, including field names and types.
  2. After synchronization, click the "Intelligent Data Knowledge Supplement" at the top right:
    • The system will intelligently supplement business aliases, field descriptions, and other information based on field names.
    • If the generated results do not match the actual business, you can manually modify the field descriptions to ensure accuracy.
  3. Repeat the same operation for the second table coffee_sales_0613 to synchronize and supplement field descriptions.

Through structure synchronization and field supplementation in the data catalog, the system can correctly recognize the meaning of fields, thereby providing more accurate support when generating reports and insights later.

Creating a Business Domain for Coffee Sales Data

To better organize and manage sales data and improve reusability and maintainability when building intelligent analysis reports later, we need to create an independent Business Domain for the coffee sales data.

Steps to Create a Business Domain:

  1. In the system's Data module, click "Business Domain" in the left menu bar.
  2. Click the "+ Business Domain" button at the top right to enter the business domain creation page.
  3. Fill in the following information:
    • Business Domain Name: coffee sales
    • Select Data Source: choose the previously created data source coffee from the dropdown
    • Business Domain Description:
      The coffee sales data domain covers the entire process of managing data from coffee product sales records, customer purchasing behavior to sales channels. Analyzing this data helps optimize inventory, improve sales strategies, and enhance customer satisfaction.

    • Prompt Information:
      Please ensure the completeness and accuracy of sales data to support effective business analysis and decision-making.

  4. After filling in the information, click "Confirm" to complete the creation of the business domain.

Configuring Business Domain Table Relationships

After the business domain is successfully created, the system will automatically enter the business domain configuration page. At this point, you need to add the actual coffee sales data tables to the business domain panel and configure the logical relationships between them.

Adding Data Tables to the Business Domain Panel:

  1. In the business domain configuration interface, select and check the two tables:
    • coffee_sales
    • coffee_sales_0613
  2. After checking, the two tables will appear in the business domain panel.

Creating Relationships Between Tables:

  1. In the panel, find the coffee_sales_0613 table and locate the "Relationship List" below the table.
  2. Click the "+" button to create a new relationship.
  3. In the popped-up relationship setting dialog, fill in the following:
    • From Table Field: coffee_sales_0613.id
    • To Table Field: coffee_sales.id
    • Relation Type: select "One-to-One"
  4. Click "Confirm" to complete the relationship creation.
  5. After creation, the panel will display a one-to-one relationship line connecting the two tables.

Saving Business Domain Relationship Configuration:

Click the "Save" button at the top right. The system will store the current configured table structures and relationship settings.

At this point, the business domain configuration is complete, laying a solid foundation for building intelligent reports later. The system will more accurately parse data fields and understand data semantics based on this, supporting natural language analysis and chart generation.

Creating Intelligent Sales Analysis Reports

After completing data access, data catalog configuration, and business domain construction, we are fully prepared to build intelligent BI reports. Next, we will start officially creating the sales analysis report.

Entering the Intelligent BI Analysis Module

  1. Enter the Data module in the system.
  2. Click "Data Agents" in the left menu bar.
  3. In Data Agents, click "Intelligent BI".
  4. The system will jump to the intelligent BI report creation interface.

Selecting the Business Domain

  1. Click "Select Business Domain" on the left side of the page.
  2. In the popped-up business domain list, select the previously created business domain coffee sales.
  3. After successful selection, the page will automatically load the two tables under this business domain:
    • coffee_sales
    • coffee_sales_0613 These data tables will serve as the data foundation for subsequent analysis.

Using Natural Language to Generate Charts

Intelligent BI supports natural language analysis, greatly lowering the threshold for data analysis. Here is a practical example:

  1. Enter in the natural language input box at the top of the page: 统计不同咖啡类型的销售总量 (Calculate the total sales of different coffee types)
  2. After receiving the request, the system will automatically recognize the analysis intent and generate the corresponding SQL query statement.
  3. After the query is executed, the system will automatically generate a visual chart.

By default, the system usually displays data as a line chart. But in this example, we focus more on comparing total sales, so it is more suitable to use a bar chart for display.

Adjusting Chart Styles

To improve the readability and visual effect of the report, we can optimize the chart style:

  1. Click the "Edit Style" button at the top right of the chart.
  2. The Style Editing Panel will pop up on the right side of the page, where you can customize the chart display effects.

The style settings used in this example are:

  • Chart Title: change to Total Sales (Coffee Type)
  • Chart Type: select Bar Chart
  • X-axis Field: coffee_type (Coffee Type)
  • Y-axis Field: total_sales (Total Sales)
  • Theme Style: can be selected according to business scenarios and personal preferences. Here, it is recommended to choose a blue style to highlight a clear and professional visual feel.

The system supports real-time preview of chart styles, allowing you to adjust and view chart changes simultaneously, avoiding the inconvenience of repeated modifications.

After completing the above settings, an intuitive, clear, and data-driven coffee sales analysis chart is built, providing a good foundation for subsequent insights.

Enabling Intelligent Data Insights

After completing the sales report construction, we can further utilize the system's intelligent insight feature to mine potential trends and business opportunities from the data, assisting deeper analysis and decision-making.

Quickly Generating Automatic Insights

  1. Click the "Insights" button at the top right of the report page.
  2. The system will automatically perform intelligent analysis based on the current chart's dimensions and metrics and output a set of data insight results.

These automatically generated insights include but are not limited to:

  • Trend Analysis: Identify sales change trends, such as a certain coffee type's sales significantly rising or falling during a specific period.
  • Correlation Analysis: Determine correlations between different fields, such as whether there is a sales association between a coffee type and store location.
  • Difference Analysis: Identify significant differences between categories, such as sales performance differences of different coffee types across regions.
  • Data Summary: The system automatically extracts key conclusions based on chart content, facilitating quick understanding of the business meaning behind the data.

Customizing Natural Language Insights

Besides system automatic insights, you can also input more specific analysis requirements and initiate deep insights in natural language form.

  • Enter in the input box below: 各咖啡类型在总销售中的占比变化 (Changes in the proportion of each coffee type in total sales)
  • The system will generate new data queries and analysis logic based on this question and return insights related to this topic.

This method is especially suitable for business personnel to explore data through "questioning," quickly obtaining valuable information. By combining automatic and customized approaches, the insight feature not only expands the usability of charts but also further enhances the intelligence and business value of data analysis.

At this point, a complete data access → report creation → intelligent insight sales analysis process has been built, providing the business team with an intuitive, efficient, and intelligent data analysis tool.

Publishing Intelligent BI Reports

After completing report creation, you can publish the report for later viewing or sharing.

The system supports two publishing locations:

  • My Reports: visible only to yourself, suitable for personal viewing and saving.
  • Report Center: visible to team members, suitable for sharing and collaboration.