How to Use the Data Aggregation Agent

Attention

Responses generated by the AI are not always accurate. When using them for important decisions, please verify the validity of the results.
The AI chat dialog is an interactive screen for querying table data using natural language.
When you enter a question in chat format, the AI automatically aggregates the data and displays the results.
../../../_images/img_01.en152.png

[1] Message area

User questions and AI responses are displayed in chronological order.
AI responses include text replies as well as data previews.

[2] Input field

A text area for entering your question.
Enter your question about the table data in natural language.
Press Shift + Enter to insert a new line in the input field.

[3] Send button

Sends the entered question to the AI.
You can also send by pressing the Enter key.

[4] New chat button

Clears the current chat history and starts a new chat.

[5] Saved queries button

Displays a list of saved query conditions.
You can select from the list to re-execute a query.
For how to save query conditions and things to note when saving, please refer to Actions on results described later.

[6] Target data items

../../../_images/img_09.en61.png
Displays the data items used by this agent to generate responses.
The tables and columns shown here are the targets for querying.

[7] Help button

Click to open this help page.

Executing a query

Note

Each AI response for preview generation, explanation, or a question consumes one AI usage count from your license.
However, executing saved query conditions does not consume any AI usage count.
  1. Enter a question in the input field.

    Enter your question about the table data in natural language.

    Examples:

    • "Show me the total sales for last month"
    • "Display the number of orders per customer in descending order"
    • "List all products with stock of 10 or fewer"
  2. Click the send button or press the Enter key to send your question.

    The AI interprets the question and automatically executes data aggregation.
  3. The AI response is displayed.

    The following information is displayed as the AI response.
    • Preview data - The aggregated data is displayed in table format. The preview displays up to 20 records. If there are more than 20 records, you can retrieve all records by exporting them.
    • Explanation - Provides an easy-to-understand explanation of how the AI aggregated the data.
    You can sort the displayed data in ascending or descending order by clicking the column headers in the preview data.

Tip

Chat can be continued. You can ask follow-up questions or refine conditions based on the context of your previous question.
Example: "Show me the total sales for last month" -> "Show only the Tokyo portion of that"

Actions on results

You can perform the following actions on the results.
../../../_images/img_02.en140.png

[1] Export button

../../../_images/img_03.en114.png
Exports the results. You can choose from the following two export methods.
  • Output to sheet - Outputs the results to a CELF sheet. The number of data records that can be output is limited to the maximum number of rows in the sheet.
  • Output to CSV - Downloads the results as a CSV file. All records are downloaded regardless of the number of records displayed in the preview.

[2] Save query button

../../../_images/img_04.en103.png
You can save frequently used queries as saved query conditions.
Clicking the button displays the save query screen along with the displayed explanation. Set a name of your choice and save.
Saved query conditions can be recalled and re-executed from the saved queries button next to the input field.
Query conditions are saved per app and can only be used by the user who saved them.
To execute a saved query condition, the current action settings (target tables, columns, etc.) must include the settings from when it was saved. If target tables or columns are removed after saving, the saved query condition may no longer be executable.

See also

When executing saved query conditions or performing CSV output, only data from tables for which the updater of the sheet with the action set has read permission can be retrieved.
For details on permission checks, please refer to Permission check for SQL actions.

Tips for asking questions

Here we introduce key points for obtaining more accurate results and examples of commonly used questions.
Please replace the actual column names and table names to match your environment.
*Since results are auto-generated by AI, they may differ from the examples even for the same question.

[1] Aggregation combining multiple tables (Budget vs. Actual management example)

This is a case of joining multiple tables to perform cross-table aggregation and analysis.
Here, we combine the 'Budget Table' and the 'Actual Table' to compare budget against actual results.

Important

While the AI automatically infers relationships between tables to some extent, it is important to pre-register the following in the column description field of Table supplementary information for more accurate joining.
  • "The department ID in the actual results table contains the ID from the department master"
  • "The department ID in the budget table uses the same ID as the department master"
This allows the AI to join tables using the correct keys, while also eliminating the need to specify table names and join columns with each question, and preventing aggregation errors and unintended duplicates.

Example questions:

"Please calculate the budget amount, actual amount, and achievement rate for each department and month of the current fiscal year, and display them in a cross-tabulation with departments on the vertical axis and months on the horizontal axis (3 columns per month: budget, actual, and achievement rate). Please also add the annual cumulative budget, annual cumulative actual, and annual cumulative achievement rate for each department in the final column."

Result returned:

../../../_images/img_05.en93.png
A cross-tabulation is displayed with columns for Department, April Budget, April Actual, April Achievement Rate, May Budget, May Actual, May Achievement Rate, …, March Budget, March Actual, March Achievement Rate, Annual Cumulative Budget, Annual Cumulative Actual, and Annual Cumulative Achievement Rate.
You can get a bird’s-eye view of budget, actual, and achievement rate arranged by month, and quickly identify months or departments where progress is delayed.

[2] Aggregation involving values that require definition (Project management example)

This is a case of informing the AI of the meaning of values managed as integers, etc., before aggregating.
Here, we have the AI correctly interpret the status in the project table and aggregate the number of orders and order rate by person in charge and by quarter.

Important

To correctly aggregate the number of orders and order rate, the AI needs to know the status value corresponding to 'order received'. When statuses are managed as integers, the AI cannot determine the meaning of the numbers, so it is important to pre-register the following in the Examples field of Table supplementary information.
  • "Status examples: 1=Order received, 2=Order lost, 3=In negotiation"
This allows the AI to correctly interpret and aggregate, such as "number of orders received = count where status is 1" and "number of negotiations = count where status is 3".

Example questions:

"Please aggregate the number of negotiations, number of orders, order rate, and total order amount by person in charge and by quarter, and display them in a cross-tabulation with persons in charge on the vertical axis and quarters on the horizontal axis (3 columns per quarter: number of orders, order rate, and order amount). Please also add the total number of orders, total order amount, and annual order rate for each person in charge this fiscal year in the final column."

Result returned:

../../../_images/img_06.en78.png
A cross-tabulation is displayed with columns for Person in Charge, Q1 Orders, Q1 Order Rate, Q1 Order Amount, Q2 Orders, Q2 Order Rate, Q2 Order Amount, …, This Year’s Orders, This Year’s Order Rate, and This Year’s Order Amount.
You can compare count, rate, and amount for each quarter at a glance, and identify strong and weak quarters for each person in charge.

[3] Aggregation involving business-specific formulas (Inventory management example)

This is a case of aggregating using in-house proprietary metrics or formulas.
Here, we use the inventory table and a company-defined inventory health score to understand the situation by category in a ranking format.

Important

Company-specific metrics like the 'inventory health score' cannot be inferred by the AI unless the formula is explicitly stated. For calculations involving business-specific concepts or weightings, always specify the formula in your question.
  • Example: Inventory health score = (Sales in last 30 days × 3 + Sales in last 60 days × 2 + Sales in last 90 days) ÷ Current inventory × 100

Example questions:

"Please calculate the average inventory health score ((Sales in last 30 days × 3 + Sales in last 60 days × 2 + Sales in last 90 days) ÷ Current inventory × 100) for each product category and display them in ascending order of score."

Result returned:

../../../_images/img_07.en73.png
A list of product categories and average inventory health scores is displayed in ascending order of score.
You can quickly identify categories that require attention.

[4] Checking filter conditions in advance

This is a case of first checking what values are registered in a column when you want to filter by a specific value.
By checking the values first before asking your question, you can prevent errors in specifying conditions.

Example questions:

"What values are registered in the status field?"

Result returned:

../../../_images/img_08.en69.png
A list of values present in the status column is displayed (e.g., 'Pending', 'Processing', 'Completed', 'Cancelled').

Example question after checking (continue conversation to narrow down):

"List orders with status 'Completed' in descending order of order date"

Troubleshooting

If you still cannot get the expected results after reviewing Tips for asking questions and Improving query accuracy, check whether the following cases apply.

[1] Incorrect results when combining multiple tables

When querying by combining multiple tables, the AI may not be able to correctly identify the columns used for establishing relationships between tables.
For example, if columns with similar names exist in multiple tables, the AI may not be able to determine which columns should be associated with each other.
In this case, the following measures are effective.
  • In Table supplementary information, describe in the column description which table it relates to, such as "Contains the ID value of the XX table".
  • Remove unnecessary columns from the target in the action settings. Reducing unnecessary columns will improve accuracy as well as processing speed.

[2] Unable to retrieve data matching conditions

The AI queries based on the table structure and configured table supplementary information, but does not know the actual contents of the data.
When filtering by specific fixed values such as "Dept. XX" or "Product Code ABC", the value must exactly match the data.
However, for conditions that represent a range or period, such as "within this fiscal year", the AI can interpret them to some extent.

Hint

If you cannot filter effectively using a fixed value, it is also useful to first query what values are registered to check the data contents, then ask again using that value. For specific question examples, please refer to Tips for asking questions [4] Checking filter conditions in advance.
This may be improved by registering data formats and specific values in the data examples of Table supplementary information.

[3] Aggregation does not match intention due to ambiguous query

For queries such as "Show me sales", the AI determines what "sales" refers to based on column names and table supplementary information.
For example, if there is an "expense category" column and an "amount" column, the meaning of the amount (sales, expenses, etc.) changes depending on the expense category. In such cases, the AI may not be able to identify what the instruction "sales" specifically refers to.
Accuracy can be improved by explicitly stating this in your query, such as "Show the total amount for expense category 'sales'", or by registering this information in the column description of Table supplementary information.

[4] Vertical and horizontal axes not displayed as expected

When you want to retrieve a table with swapped rows and columns (cross-tabulation) by month or item, it is effective to explicitly specify the vertical and horizontal axes in your question.
Examples:
  • "Display monthly sales arranged horizontally"
  • "Display total sales in a cross-tabulation with vertical axis: product category, horizontal axis: month"

[5] Checking table definitions

If column data types are not appropriate, the AI may not be able to correctly aggregate or compare data.
When reviewing table column definitions, please check the following points.
  • Do not define numeric columns as strings - For columns handling numeric values such as amounts and quantities, avoid defining them as strings. For example, instead of including units in the amount column value such as '1000 yen', manage units separately and register the value as an integer '1000'. Columns defined as strings may not work as intended for aggregations such as totals and averages, or for magnitude comparisons.
  • Define dates as date or datetime - Avoid defining columns that handle dates as strings. Managing dates as strings may cause filtering by date range or sorting to not work correctly.
  • Align the types of key columns when joining multiple tables - When combining multiple tables, if the data types of key columns used for joining differ between tables, processing may become slow. Define the columns used for joining to have the same data type across tables.