# Create a new dataset from a dataset

Use this documentation to know how to create a dataset from another dataset. if you are looking to create a dataset from a datasource refer to this [documentation](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector).

## How to create a dataset from another dataset

Toucan allows to create a dataset from another dataset.

the resulted dataset will be a child dataset of the parent dataset. You can create You can create as many child datasets of a parent dataset as you want. When a child dataset is executed, its parent dataset(s) are executed beforehand.\\

To create a child dataset from another dataset

* Go to the `datasets` tab in the DataHub

1. Click on the <i class="fa-file">:file:</i> with a plus icon (“Home 1” in the example) on hover a label “Create a new dataset from this one” will be displayed

   <figure><img src="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-1e50130724aeb70a4287ef01a3f9a62d9d77636a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
2. After clicking on `Create a new dataset from this one`, you will have access to YouPrep™ (know more about YouPrep [here](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm))

   <figure><img src="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-2d6b4fb9b40a0be4544f1a11e6f87f937b85e159%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Save the new dataset by clicking on the button "`Create`" (at the bottom).
4. A modal will opened, choose an unique name for the dataset, and select the [storage type](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/stored-and-live-datasets) `stored` or `live`
5. Then click on `Save` If you store the dataset in Toucan, you also can `Save and refresh` the dataset in order to make it available to use.

**Tip**: you can even create a child dataset from the Story Panel. You'll be redirected to the DataHub tab while you create your new child dataset. Take a look at this video.

### Stored datasets specificities

**Dataset refresh**

Refreshing a dataset will also **refresh all direct and indirect parent datasets**.

**Save a stored dataset**

If you save a "stored dataset" without refreshing it, it won't make it available to create other datasets with it, or to build charts by using the dataset.

{% hint style="info" %}
You can use save without refreshing your dataset if your dataset is not completely ready to be used.
{% endhint %}

**Dataset download**

When the dataset is stored in Toucan, it's possible to download it as CSV file, though the action menu of the dataset (on the right part in the listing of the dataset).

## Create a child dataset when configuring a tile/story

You can create a child dataset when you are configuring a tile/story as shown in this video

{% embed url="<https://youtu.be/keM8HYDVB1c>" %}
Child Dataset Creation from a Story
{% endembed %}

{% hint style="info" %}
**Variables use**

If you use **variables** within the YouPrep transformations, you can only save your dataset as LIVE.
{% endhint %}

{% hint style="warning" %}
**Permissions**

If you create a new dataset A, from dataset B that has **permissions** applied, and define the new dataset A as a **Stored** dataset, the permissions of the parent dataset won't be applied anymore. You will have to define the permissions again on your dataset if you need to secure the access to the data.
{% endhint %}

{% hint style="warning" %}
**Dataset column naming**

When the dataset is stored within Toucan, the column names should respect the following constraints:

* The dataset shouldn't contain a column named "**\_id**"
* The dataset name shouldn't contain points ("**.**")
  {% endhint %}

{% hint style="warning" %}
**Limits on number of rows**

The maximum number of rows is set at **1M** (for both live and stored dataset). However, when being under [NativeSQL](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql) that results on a dataset that has less than 1M of rows, there wont be any limitation.
{% endhint %}
