# Dataset
> Learn how to create, explore, and share datasets with ease in Holistics
:::tip Knowledge Checkpoint
A grasp of these concepts will help you understand this documentation better:
- [Data Model in Holistics](/docs/data-model)
- [Create Relationships between Data Models](/docs/relationships)
:::
## Introduction
In Holistics, a **Dataset** is a "container" holding several [data models](/docs/data-model.md) together so they can be explored together, and dictating which join path to be used in a particular analytics use case.
In other words, Dataset is like a mini **data mart** that enables:
- **Data Exploration:** Dataset can be shared to Explorers (non-technical users) to do self-service exploration of the data.
- **Creating Charts:** All Charts in Holistics have to be created from a dataset.
## Create a dataset
To create a new dataset, go to the Development, click on the `+` symbol next to a folder, and select **Add Dataset**.
A new screen will appear, and here you can add more details to your datasets and select models to be included.
After clicking **Create Dataset**, the new dataset will appear in your the folder tree as a file with the following format: `my_dataset_name.dataset.aml`.
Alternatively, you can also write the `.dataset.aml` file from scratch. In the next section, we will briefly go through the items in the dataset's code representation.
## Dataset components
:::info Reference
Please refer to [AML Dataset Reference](/reference/aml/dataset) to learn more about all available parameters and their example usage.
:::
In general, a dataset has the following components:
- **Dataset metadata:** dataset labels, descriptions, owners, and the data source that the dataset will query from.
- [**Data models**](/docs/data-model) included in the dataset.
- [**Relationships**](/reference/aml/relationship) between the included models.
- [**Metrics**](/as-code/aql/learn/what-aql-is-for) for complex aggregations.
- [**Dimension**](/docs/dimensions-in-datasets) for complex cross-model reporting use cases.
- [**Dataset Views**](/docs/datasets/custom-views) for customizing the look of the dataset.
Putting together, a dataset definition has the following form:
Dataset definition
```aml
// demo_ecommerce.dataset.aml
Dataset simple_dataset {
// Basic metadata
label: '[Demo] Ecommerce'
description: 'Demo dataset for E-commerce use cases test'
owner: 'demo@holistics.io'
data_source_name: 'demodb'
// List of models in the dataset
models: [
orders,
order_items,
users,
products,
categories
]
// Relationships between models
relationships: [
relationship(orders.user_id > users.id, true),
relationship(order_items.order_id > orders.id, true),
relationship(order_items.product_id > products.id, true),
relationship(products.category_id > categories.id, true)
]
// Metrics
metric count_orders {
label: 'Count Orders'
type: 'number'
definition: @aql orders.id | count() ;;
}
metric sum_order_value {
label: 'Sum Order Values'
type: 'number'
definition: @aql order_items | sum(order_items.quantity * products.price) ;;
}
metric average_order_value {
label: 'Average Order Value'
type: 'number'
definition: @aql sum_order_value / count_orders;;
}
// Dimension
dimension acquisition_month_cohort {
model: users
type: 'date'
label: 'Acquisition Month Cohort'
definition: @aql min(orders.created_at | month()) | dimensionalize(users.id);;
}
// Dataset view definition
view {
model orders { }
model users { }
group relevant_models {
model products { }
model categories { }
}
group business_metrics {
metric sum_order_value
metric average_order_value
}
}
}
```
## Interactions with dataset
### Explore dataset
Users can easily explore their data with the familiar drag-and-drop interface, and save the result as a widget in a dashboard.
You can also explore a report / dashboard widget's result by clicking on it and choose "Explore Data". For more details, please refer to [Explore Data](/docs/data-exploration).
### Share dataset
You can share datasets to specific users or groups. Note that while you can group dashboards or reports into a folder and share them all at once, this is not supported for datasets — each dataset must be shared individually. This is because datasets represent the underlying data model and can expose large portions of your database or multiple tables at once.
## Best practices
For best practices on creating, organizing and optimizing performance of datasets, please refer to [Best Practices](/docs/datasets/best-practices).