Manage ChatBI datasets

更新时间:
复制 MD 格式

Before starting a ChatBI session, you must create a dataset to define the data for analysis. A dataset can be a table from a data source or a local file.

Prerequisites

You must have a Serverless resource group in the same region where you use ChatBI.

Usage notes

  • For datasets from a data source, ChatBI supports only Hologres, MaxCompute, StarRocks, and MySQL.

  • For datasets from local files, only the xls, xlsx, and csv formats are supported. You can upload a maximum of 10 files, and each file cannot exceed 1 GB in size.

Create a dataset

  1. Go to the ChatBI page.

    Log in to Alibaba Cloud, then access the ChatBI intelligent data insights page in your browser. Select the access point that corresponds to the region of your DataWorks resources, such as your Serverless Resource Group and Datasets.

    China (Hangzhou)

    China (Shanghai)

    China (Shenzhen)

    China (Hong Kong)

    China (Chengdu)

    China (Beijing)

    China (Zhangjiakou)

    Indonesia (Jakarta)

  2. In the left navigation pane, click Dataset to go to the Datasets page. Then, click Create Dataset.

  3. On the Create Dataset page, configure the following parameters:

    • If the dataset type is Data Source:

      Parameter

      Description

      Basic Information

      Name

      Enter a custom name for the dataset.

      Type

      The type of the dataset. Valid values:

      • Data Source

      • Local File

      In this example, Data Source is selected.

      Data Source Type

      The type of the data source. Valid values:

      • Hologres

      • MaxCompute

      • StarRocks

      • MySQL

      Data source information

      Configuration parameters vary based on the data source type.

      For example, if you select Hologres, you must configure Region, Hologres Instance, and Database Name.

      Resource Group

      This resource group is used to access the data source and run queries in subsequent sessions.

      Test Network Connectivity

      Verifies the connection between the selected DataWorks Serverless resource group and the data source.

      Select Destination Table

      Select target tables

      After you configure the Basic Information, click Next to go to the Select Destination Table step.

      In the To Be Selected list, select the target data tables and click the image icon to add them to the Selected list.

    • If the dataset type is Local File:

      Parameter

      Description

      Basic Information

      Name

      Enter a custom name for the dataset.

      Type

      The type of the dataset. Valid values:

      • Data Source

      • Local File

      In this example, Local File is selected.

      Upload Local File

      You can upload local files in xls, xlsx, and csv formats. You can upload a maximum of 10 files, and each file cannot exceed 1 GB in size.

  4. After you configure the dataset, click Next to go to the Data Insight step. ChatBI automatically scans the dataset to identify its characteristics, which improves analysis accuracy in subsequent sessions.

  5. The Data Insight process might take a long time. You can click Completed and view the results later on the dataset details page.

View a dataset

  1. In the left navigation pane, click Dataset to go to the Datasets page.

  2. Find the target dataset card and click it to open the dataset details page.

  3. The dataset details page displays basic information at the top, such as type, creator, and the number of tables or files. A list of tables or files is on the left, and the right side shows details and a data preview for the selected item. You can preview up to 20 data records.

    image

Edit a dataset

  1. In the left navigation pane, click Dataset to go to the Datasets page.

  2. You can open the dataset edit page in two ways:

    • Hover over the target dataset card and click image > Edit in the upper-right corner.

    • Click the target dataset card to go to the details page, and then click the Edit button in the upper-right corner.

  3. Modify the dataset configuration. For more information about the parameters, see Create a dataset.

    Note

    When you edit an existing dataset, you cannot modify the Type and Data Source Type parameters.

  4. After you finish editing the dataset, click Next to go to the Data Insight step and rerun Data Insight on the dataset.

Delete a dataset

  1. In the left navigation pane, click Dataset to go to the Datasets page.

  2. Hover over the target dataset card and click image > Delete in the upper-right corner. After you delete a dataset, its associated sessions and charts can no longer display data.

Next steps: Start a session from a dataset

  1. You can start a session from a dataset in two ways:

    • In the left navigation pane, click Dataset to go to the Datasets page. Hover over the target dataset card and click the image icon in the upper-right corner to start a chat.

    • In the left navigation pane, click New Chat to open the ChatBI session window. In the session window, click Select Dataset.

      image

  2. On the Chat page, enter your requirements or questions to start data analysis. For more information, see ChatBI sessions.

Tips for asking questions

The quality of ChatBI's analysis depends on how you ask questions. The following tips can help you obtain more accurate and valuable data analysis results.

Define a clear analysis objective

A good analysis question should include a clear subject, specific metrics, and defined dimensions.

Well-formed questions

Vague questions

Monthly sales trend for the East China region in 2025

Show me the sales figures

Daily new users and their year-over-year growth rate for the last 7 days

How has user growth been recently?

Top 10 product categories by return rate and the distribution of return reasons

Are there many returns?

Use time ranges and filter conditions

Specifying a time range and filter conditions in your questions helps ChatBI generate more precise SQL and avoid unnecessary full table scans.

  • Specify a time range: For example, "gross margin for each product line in Q4 2025" is more precise and reduces the amount of data queried than "gross margin for each product line".

  • Specify filtering dimensions: For example, "average transaction value distribution for VIP customers in the North China region" is more targeted than "what is the average transaction value".

  • Use business terms: Use actual field values from data tables or business terms defined in the knowledge base when asking questions. For example, use status='completed' instead of "orders that are completed" to help ChatBI accurately match data.

Break down complex requests into steps

For complex analysis, break down your request into a series of simple, step-by-step questions.

  • Step 1: Get an overview: Start with a high-level question to understand the overall trend. For example, "Overall sales trend by month for 2025".

  • Step 2: Identify anomalies: If you find an anomaly, ask a targeted follow-up question. For example, "Break down the reasons for the sales decline in March by product category".

  • Step 3: Perform attribution analysis: Further investigate the cause of key findings. For example, "Which sub-categories in the electronics category had the largest decline in March?".

Use multi-turn conversation techniques

ChatBI supports continuous, multi-turn questions within the same session. The following techniques can help you perform multi-turn analysis more efficiently.

  • Ask follow-up questions for details: Build on the results of the previous turn. For example, first ask "Rank of sales by region", and then follow up with "Monthly sales details for the top-ranked region".

  • Correct the instructions: If the analysis results are not what you expected, you can specify the required adjustments in the next turn. For example, "Summarize the above results by quarter, not by month" or "Please exclude test data and only show official orders".

  • Switch visualizations: You can request different ways to display the same data. For example, "Display the above data as a pie chart" or "Please sort in descending order".

Handle inaccurate results

If ChatBI provides inaccurate results, try the following methods:

  • Check table matching: In the "Identify Target Tables" step of the analysis result, verify that ChatBI has selected the correct data tables. If ChatBI matched the wrong table, you can specify the table name in your question, for example, "Analyze sales by category based on the ods_order_detail table".

  • Refine your question: Rephrase your question using more precise business terms and clear metric definitions. For example, change "How many active users are there?" to "Count of unique users with login activity in the last 30 days".

  • Improve the knowledge base: If a certain type of question consistently yields inaccurate results, we recommend that the administrator add corresponding question templates, terms, or business logic to the knowledge base. ChatBI will then prioritize the information in the knowledge base to understand and handle such questions.

  • Check the generated SQL: Expand the SQL code in the "Generate Execution Plan" step to verify if the query logic is correct. If there is an issue, you can copy the SQL, modify it manually, and then run it. You can also add the corrected SQL to the knowledge base as a question template.

Data source configuration

MySQL

  • Full table scan risk: The SQL generated by ChatBI based on your questions may perform a full table scan. If the table contains a large amount of data (millions of rows or more), this can place a high load on your database. We strongly recommend using a read-only replica or a secondary database as the data source for your dataset to avoid impacting your production environment.

  • Index optimization: Create an index on frequently queried filter fields, such as time, status, or category columns, to accelerate the execution of SQL generated by ChatBI.

  • Field naming: Use English field names with clear business meanings, such as order_amount and customer_name, and add field comments. ChatBI relies on field names and comments to understand the table structure. Good naming can significantly improve the accuracy of target table matching and SQL generation.

  • Use cases: Suitable for business database query scenarios with data volumes up to tens of millions of rows, such as order analysis and customer management for online business data.

Hologres

  • Partition table design: We recommend that you use a partition table and partition it by time, such as by date or month. When querying a partition table, the SQL generated by ChatBI can automatically perform partition pruning, which significantly reduces the amount of data scanned and helps prevent query timeouts caused by an overly large query scope.

  • Table and column comments: Hologres supports adding COMMENT to tables and columns. ChatBI reads these comments to understand data semantics. We recommend that you add Chinese comments to each table and key field to describe their business meaning.

  • Hybrid row-column storage: For query scenarios in ChatBI that primarily involve aggregate analysis, we recommend using columnar storage for better query performance.

  • Use cases: Suitable for real-time and near-real-time data analysis scenarios. It supports interactive queries on hundreds of millions of rows of data and is especially well-suited for real-time dashboards and real-time metric analysis.

MaxCompute

  • Partition pruning: MaxCompute is a processing engine for massive data, and a single query may scan a large amount of data. We strongly recommend using partition tables and ensuring that frequently used filter dimensions, such as date and region, are used as partition keys. When ChatBI generates SQL, it tries to use partition conditions to reduce unnecessary full table scans.

  • Query latency: MaxCompute is an offline batch processing engine, and query response times typically range from a few seconds to several minutes, depending on the data volume and query complexity. If you require responses in seconds, we recommend using Hologres or StarRocks.

  • SQL dialect differences: MaxCompute uses its own SQL dialect, and some functions and syntax differ from standard SQL. ChatBI adapts to the MaxCompute SQL syntax and automatically generates compliant SQL. If a generated SQL query returns an error, you can add a question template to the knowledge base to guide correct SQL generation.

  • Use cases: Suitable for massive offline data analysis scenarios at the terabyte to petabyte scale, such as historical data trend analysis and comprehensive user behavior analysis.

StarRocks

  • MPP architecture features: StarRocks uses a massively parallel processing (MPP) architecture and excels at multi-dimensional analysis and complex aggregate queries. Multi-dimensional analysis questions in ChatBI typically perform well on StarRocks.

  • Materialized views: If certain aggregate queries are frequent, we recommend creating a materialized view in StarRocks to accelerate them. ChatBI automatically uses materialized views to improve query performance.

  • Data modeling: StarRocks supports various data models, including the Duplicate Key, Aggregate, Unique Key, and Primary Key models. For ChatBI analysis scenarios, the Duplicate Key model is suitable for flexible multi-dimensional analysis, while the Aggregate model is suitable for fixed-metric query scenarios. Choose the appropriate model based on your actual analysis needs.

  • Use cases: Suitable for real-time multi-dimensional analysis and ad-hoc query scenarios. It supports query responses in seconds for data volumes of hundreds of millions of rows and is especially well-suited for user behavior analysis and real-time reporting.