Skip to main content

๐Ÿค– AI Copilot

General Functions of AI Copilotโ€‹

For the general functions of the AI Co-pilot, please refer to ๐Ÿค– AI Copilot.

Global Commands for Modelsโ€‹

In the semantic model interface, the AI Co-pilot offers the following commands:

/dimensionโ€‹

The /dimension /d ๐Ÿฆœ๏ธ๐Ÿ”— command is used to create a shared dimension based on table information and user queries.

tip

The user needs to provide the necessary dimension table information, which can be inserted into the conversation by dragging the table names from the data table area to the Co-pilot.

Example:

/d create dimension called 'product_category' includes product, category, and model levels.

/cubeโ€‹

The /cube /c ๐Ÿฆœ๏ธ๐Ÿ”— command is used to create a cube based on table information and user queries.

tip

The user needs to provide the necessary cube information, which can be inserted into the conversation by dragging the table names from the data table area to the Co-pilot.

Example:

/cube create cube called 'sales_cube' that includes shared dimensions: product and customer, and measures: sales amount, product cost, sales profit.

Query Lab Commandsโ€‹

In the Query Lab interface, the AI Co-pilot offers the following command:

In this interface, the Co-pilot conversation can be saved in the query records, and when the user reopens a query, the Co-pilot conversation content will be restored. For more Query Lab features, please refer to Query Lab.

/queryโ€‹

The /query /q ๐Ÿฆœ๏ธ๐Ÿ”— command is used to execute data queries based on user descriptions. Users need to provide the necessary query logic and table information.

tip

Users can drag table names from the table area to the Table Structure area to provide the necessary table information.

/query Customer sales per year per country

SELECT
c.country_region,
SUBSTRING(s.order_date_key, 1, 4) AS year,
SUM(s.sales_amount) AS total_sales_amount
FROM
adv_sales s
JOIN adv_customer c ON s.customer_key = c.customer_key
GROUP BY
c.country_region,
year
ORDER BY
c.country_region,
year;

The command will automatically execute the query and return the results.

To modify the query statement:

/query Change the country field to the city field

Querying Multidimensional Data Sourcesโ€‹

If the semantic model's data source is a multidimensional data source (such as SAP BW, Microsoft Analysis Services, etc. that support Xmla interface services), the Query command will automatically use MDX syntax for querying.

/query sum SignData for every entity where category is [/CPMB/OUDV1E2].[Actual]

SELECT
{[Measures].[/CPMB/SDATA]} ON COLUMNS,
{[/CPMB/OUDMS0O].[LEVEL01].Members} ON ROWS
FROM [$/CPMB/OUMFJWF]
WHERE {[/CPMB/OUDV1E2].[Actual]}

Dimension Interface Commandsโ€‹

The following commands are available:

/hierarchyโ€‹

The /hierarchy /h ๐Ÿฆœ๏ธ๐Ÿ”— command is used to create a new hierarchy.

tip

Users need to drag the tables used from the data table area to the AI dialog box to provide the necessary dimension table information. If no table information is provided, the Co-pilot will create the hierarchy based on the tables currently used in the dimension.

Example:

/h Create a hierarchy that includes product and category.

Dataset Commandsโ€‹

The following commands are available:

  • /story Create a new story dashboard based on the current dataset and user description.
  • /calculation /calc ๐Ÿฆœ๏ธ๐Ÿ”— Create a new calculated member.

Query interface

Calculation interface

/storyโ€‹

The /story command is used to create a new story dashboard based on user descriptions.

/queryโ€‹

The /query /q ๐Ÿฆœ๏ธ๐Ÿ”— command is used to execute data queries based on user descriptions.

/query Create a statement to query the data: the most sales reseller

The /query command can also modify the current query statement in the editor:

/query Edit current statement referring to the error message: MDX object '[Reseller].[Reseller].[Not Applicable].[Not Applicable]' not found in cube 'Sales'

/calculationโ€‹

The /calculation /calc ๐Ÿฆœ๏ธ๐Ÿ”— command is used to create a new calculated member. Users need to provide the necessary calculation logic information.

/calc Create a calculated member
Name: Profit Margin
Formula: (Sales Amount - Cost) / Sales Amount * 100
Description: Calculate the profit margin of the product.

/formulaโ€‹

The /formula /f ๐Ÿฆœ๏ธ๐Ÿ”— command is used to edit the current calculated measure formula. Users need to provide the necessary calculation logic information.

Access Control Interface Commandsโ€‹

The following command is available:

  • /role Create a role based on user descriptions.

Virtual Cube Commandsโ€‹

/formulaโ€‹

The /formula command is used to create virtual cube calculation formula suggestions. Users can enter commands and requirements in the Co-pilot dialog box, and the Co-pilot will generate the corresponding calculation formula for you.

/formula Create a formula to calculate sales profit margin