Add New Dataset
Creating a new dataset in Max allows users to organize and structure their data in a way that makes it more accessible and understandable for natural language queries. By defining key metrics, dimensions, and filters within a dataset, users can streamline how Max interacts with their data, making it easier to explore, analyze, and gain insights without needing complex queries or technical expertise.
Create a New Dataset
- Go to the Datasets tab.
- In the top right-hand corner, click Add New Dataset.
- Choose the option to Add a dataset.
- Choose the connection to use for the dataset.
- Select a table to use for the dataset or use the Custom SQL Select option if you want to join tables. Choose Next.
- For Custom SQL Select write the select statement that will gather the data for your dataset. Choose Next.
Review and Create the Dataset
- After the data has loaded a preview of the columns and a sample of rows from your dataset will be shown.
- Confirm that the data displayed is correct, and click Create Dataset to proceed.
Extract Dimensions and Metrics
- The system will automatically begin extracting dimensions and metrics from the dataset.
- A loading indicator at the top of the screen will show the progress of this process.
- Once extraction is complete, go to the Columns tab to review all extracted columns.
Review Column Data
Common Fields
- Name: The name for the column.
- SQL: A SQL expression that defines the column. This is typically just the column name in the database could be a more complex SQL expression to create a calculated Dimension or Metric.
- Output Label: Used to show a friendly name on Charts, Tables and Insights.
- Description: A friendly description for the field. This will be used by the language model for Dimensions filters to better understand the use of the field. It is important to fill these out and for them to be clear.
- Data Type: Specify the type of data found in the column
Metric Fields
- Metric Formatting: How do format the values in charts and tables.
- Growth Type: How growth over time is calculated on the metric.
- Growth Format: How to format growth for the metric.
When using custom formatting AnswerRocket leverages Python's f-string formatting.
Dimension Fields
You can search for Dimension Values on the dimension tab of the dataset. In addition one can create mappings for Dimension values as needed. This is helpful if a database term has synonyms or is known under a different value. For example the United States of America
may be also known as USA
and US
. For common terms like this the language model will likely be able to convert to the right term but for company specific values that are not well known outside of the company mapped values can be helpful.
Calculated Metrics and Dimensions
Calculated Dimension
To create a calculated dimension in your dataset, follow these steps:
While viewing the Dataset columns, click Add New Dimension.
In the SQL field, enter a SQL expression to define your new dimension. For example, the following expression categorizes brands as either "My Brands" or "Competition":
CASE WHEN brand IN ('BARILLA', 'GIOVANNI RANA', 'BUITONI') THEN 'My Brands' ELSE 'Competition' END
This will add a new dimension to your dataset based on the criteria you define in the SQL expression.
Calculated Metric
To create a calculated dimension in your dataset, follow these steps:
While viewing the Dataset columns, click Add New Metric.
In the SQL field, enter a SQL expression to define your new metric. For example, the following expression could be used to gather a price based on Amounts and Quantity columns.:
Amount/Quantity
This will add a new metric to your dataset based on the criteria you define in the SQL expression.
Updated 3 months ago