---
title: Analysis Features
description: >-
  Perform advanced data analysis in Notebooks with SQL queries, data
  transformations, joins, and visualizations across multiple datasets.
breadcrumbs: Docs > Notebooks > Analysis Features
---

# Analysis Features

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}

{% callout %}
##### Advanced Data Sources

If you want to query data sources not yet available, use this form to submit your request.

[Request Access](https://www.datadoghq.com/product-preview/additional-advanced-querying-data-sources/)
{% /callout %}

## Overview{% #overview %}

The analysis feature in Notebooks allows you to perform advanced analysis on your Datadog data. You can join multiple datasets, chain queries, and transform your data using either predefined transformations or SQL, while retaining the full capabilities that Notebooks provide.

Notebooks are collaborative text editors that allow you to embed Datadog graphs directly into your documents. While this is ideal for exploration and storytelling, deeper investigations might require more advanced control over data queries. The analysis features enable you to run queries that help you:

- Chain queries such as aggregating existing aggregated data or joining two sets of aggregating data.
- Join data across multiple log sources and other datasets.
- Perform advanced parsing, extract data, and add calculated fields at query time.
- Visualize transformed datasets with graphs.

## Adding data to your notebook{% #adding-data-to-your-notebook %}

To run complex queries in a notebook, first add a **Data Source** cell. There are two ways to do this:

**From a notebook**:

1. Type `/datasource` and press `Enter`, or click the **Data Source** tile at the bottom of the page.
1. Type or select your desired data source from the drop down menu and press `Enter`.**Note**: if there is a data source you want that is not available, request it [here](https://www.datadoghq.com/product-preview/additional-advanced-querying-data-sources/).
1. Enter your query. Reserved attributes from the filtered logs are automatically added as columns.

**From the [Log Explorer](https://app.datadoghq.com/logs)**:

1. Enter your query in the Log Explorer.
1. Click **Analyze in Notebooks**.
1. Check the **Use as a computational data source** box and select the notebook you want to use.
1. A data source cell is added to the selected notebook with the same query you entered in the Log Explorer. By default, the columns shown in the Log Explorer are included in the data source cell.

## Configuring a data source cell{% #configuring-a-data-source-cell %}

After adding a data source cell to a notebook, you can continue modifying it to structure the data to suit your analysis needs.

### Change the time frame for the data{% #change-the-time-frame-for-the-data %}

By default, data source cells created from Notebooks use the notebook's global time frame. Data source cells created from the Log Explorer use a local time fixed to the time frame at the time of export.

You can switch any data source cell between a local or global time frame using the toggle button in the top right corner of the cell.

### Filter the data source{% #filter-the-data-source %}

Regardless of how you create the data source cell, you can modify the query using the search bar. Any changes to the query automatically re-run the data source cell and any downstream cells, updating the preview of the data.

### Add or modify a column{% #add-or-modify-a-column %}

You can add or modify columns in your data source cell. There are two ways to adjust the columns:

- In the preview section, click **columns** to search through available attributes for your data source.
- In the preview, click on a row to open the detail side panel. Click the attribute you want to add as a column, and from the pop up option, select Add "@your_column" to your "@your_datasource" dataset.

{% image
   source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/add_column_to_dataset.1a3c61b0d100b12fab5081e3034c3bb7.png?auto=format"
   alt="Opened detail side panel with the option to add an attribute column to the data source cell" /%}

### Calculated fields queries{% #calculated-fields-queries %}

You can take existing Log Explorer queries that include [Calculated Fields](https://docs.datadoghq.com/ddsql_reference/) and open them in Notebooks. To transfer these queries from the Log Explorer, click **More** and select **Analyze in Notebooks**. The Calculated Fields automatically convert into a Transformation cell.

You can also create Calculated Fields directly within a notebook to define a computed field from existing data sources. These fields can be reused in subsequent analysis:

1. Open a Workspace with a data source.
1. Add a Transformation cell.
1. Click **More operations**.
1. Select **Calculate**.

{% image
   source="https://datadog-docs.imgix.net/images/logs/workspace/calculated_fields_transformation_cell.7fb6b1c4b49db87bca69bd7aca6a3aa1.png?auto=format"
   alt="Screenshot of an example Workspaces interface with the 'Calculate' option selected from the 'More' dropdown menu, demonstrating how to add Calculated Fields to a query." /%}

## Transforming and analyzing data{% #transforming-and-analyzing-data %}

You can add various cell types to enhance your analysis capabilities. These cells enable you to include additional data sources, such as reference tables, RUM, or spans. Use SQL to join, transform, correlate, and visualize your data effectively. One of the key benefits of this approach is that cells that depend on other cells are automatically updated whenever a dependency changes, ensuring your analysis always reflects the most current data.

### Transformation cell{% #transformation-cell %}

Add a transformation cell to filter, group, join, or extract data defined in a data source cell.

1. Type `/transformation` and press `Enter`, or click on the transform dataset tile at the bottom of the page.
1. Select the data source you want to transform in the source dataset dropdown menu.

After adding the transformation cell, you can add any number of transformation operations inside the cell. Choose an operation from the list of supported transformations:

| Operation | Description                                                                                                                                                                                                |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Parse     | Enter [grok syntax](https://docs.datadoghq.com/logs/log_configuration/parsing/) to extract data into a separate column. In the "from" dropdown menu, select the column the data is getting extracted from. |
| Group     | Select what you want to group the data by in the dropdown menus.                                                                                                                                           |
| Join      | Select the type of join, the dataset to join against, and the fields to join on.                                                                                                                           |
| Filter    | Add a filter query for the dataset.                                                                                                                                                                        |
| Calculate | Add a name for the field and the function formula, using the [calculated field formulas](https://docs.datadoghq.com/logs/explorer/calculated_fields/formulas/).                                            |
| Limit     | Enter the number of rows of the dataset you want to display.                                                                                                                                               |
| Sort      | Select the sort order and column to sort on.                                                                                                                                                               |
| Convert   | Allows you to convert a column into a different type. Select the column and the column type to be converted.                                                                                               |

### Analysis cell{% #analysis-cell %}

You can also transform your data using SQL by adding an analysis cell to your notebook.

1. Type `/sql` or `/analysis` and press `Enter`, or click the **SQL Query** tile at the bottom of the page.
1. In the source dataset dropdown, select the data source you want to transform.
1. Write your SQL query. For supported SQL syntax, see the [DDSQL Reference](https://docs.datadoghq.com/ddsql_reference/).
1. Click **Run** in the top-right corner of the analysis cell to execute your query.

{% image
   source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/analysis_cell_example.ddb65fb41ee8c080c5ba68d6caf9dc8b.png?auto=format"
   alt="Example of an analysis cell with SQL query transforming data in a notebook" /%}

## Visualizing transformed data{% #visualizing-transformed-data %}

You can graph the data you've transformed using analysis cells inside a notebook, customizing the visualization with filters, aggregations, and appearance settings.

To graph your data:

1. Type `/graph` and press `Enter`, or click the **graph dataset** tile at the bottom of the page.
1. Type or select your desired data source from the drop down menu and press `Enter`.
1. Select your visualization type from the graph menu and press `Enter`.

## Viewing and exporting data{% #viewing-and-exporting-data %}

For any analysis cell that includes a dataset preview, you can view the full 100-row preview by clicking the **View dataset** button.

### Export your query to a dashboard{% #export-your-query-to-a-dashboard %}

You can save the results of any analysis cell to a dashboard by clicking **Save to Dashboard** and selecting an existing dashboard, or create a new one. Although this creates a sync between your notebook cell and the exported dashboard graph, changes to the query in your notebook do not automatically update the dashboard.

{% image
   source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/analysis_cell_save_to_dashboard.c5eb5072b6bbd2feb40468064012f598.png?auto=format"
   alt="Example of saving an analysis cell to a dashboard from a notebook" /%}

If you update the published cell or any upstream cells, a badge appears in the upper-right corner of the cell indicating **unpublished changes**. After you publish those changes, the updates sync to **all** dashboards where the query is used.

**Note**: By default, the dataset is tied to the global time frame of the **dashboard**, not to the time frame of the notebook. However, you have the ability to set a custom time frame on the dashboard widget.

### Download dataset as a CSV{% #download-dataset-as-a-csv %}

You can download data from cells for use in external tools or further processing outside of Datadog.

To download your dataset as a CSV file:

1. Navigate to any analysis cell that contains a dataset.
1. Click the download icon in the top-right corner of the cell.
1. Select the number of rows you want to export (up to the maximum available).
1. The CSV file automatically downloads to your computer.

### Schedule a CSV report{% #schedule-a-csv-report %}

With scheduled reports, you can automatically receive query results from notebook analysis cells by email, Slack, or Microsoft Teams.

To schedule a report on an analysis cell:

1. Open the dropdown next to **Save to Dashboard** and select **Schedule report**.

   {% image
      source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/schedule_report_from_cell_v2.78708602e6d6cb07ac63e4a18306b8f2.png?auto=format"
      alt="Dropdown menu showing the Schedule report option highlighted" /%}

1. In the modal, select a schedule to configure when and how often the report is sent.

   {% image
      source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/select_schedule.a17d41590bbfb6238ce095bbd74a2b82.png?auto=format"
      alt="Schedule selection step in the report configuration modal" /%}

1. Enter a report name and select a time frame to define the data included in the report.

**Note**: If the analysis cell has not yet been published as a dataset, you can specify the name of the dataset created when the report is scheduled.

1. Add email recipients.

   - The email associated with your Datadog account is included automatically. To remove it, hover over your email and click the trash icon.
   - To preview the report before saving the schedule, click **Send Test Email**.

**Note**: Only Enterprise and Pro accounts can send reports to email addresses that aren't associated with registered Datadog users.

Example report email:

   {% image
      source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/report_email.9d9631574bfe80822ada379518a9a1b9.png?auto=format"
      alt="Example report email" /%}



1. Add Slack recipients.

   - Click on the **Slack** tab, then choose a workspace and channel.
     - If no workspaces appear, verify that the Datadog [Slack Integration](https://docs.datadoghq.com/integrations/slack/?tab=datadogforslack) is installed.
     - Public channels are listed automatically. To send to a private channel, invite the Datadog Slack bot to your channel.
   - To preview the message, add a channel and click **Send Test Message.**

   {% image
      source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/add_slack_recipients.778f74f869c1ae4a4f9bfccce925c4fd.png?auto=format"
      alt="Slack recipient selection in the report scheduling modal" /%}

1. Add Microsoft Teams recipients.

   - Click on the **Microsoft Teams** tab, then choose a **Tenant**, **Team**, and **Channel**.
     - Ensure the [Microsoft Teams integration](https://docs.datadoghq.com/integrations/microsoft_teams/) is installed in your Datadog organization.
     - The Datadog app must be added to the target Team in Microsoft Teams.
   - To preview the message, add a channel and click **Send Test Message.**

1. Save your schedule.

You can view, search, edit, and delete existing report schedules from the **Reports** tab:

{% image
   source="https://datadog-docs.imgix.net/images/notebooks/analysis_features/reports_page.38fd3a37e2e63bcb0d8b51efcf21c46a.png?auto=format"
   alt="Filtered view of the Reports tab" /%}

**Note**: To schedule reports and view other users' schedules, users need the **CSV Report Schedules Write** permission. To edit other users' schedules, users need the **CSV Report Schedules Manage** permission. These permissions can be granted by a user with the **Org Management** permission.

## Further reading{% #further-reading %}

- [Learn more about Notebooks](https://docs.datadoghq.com/notebooks)
- [Getting Started with Analysis Features](https://docs.datadoghq.com/notebooks/advanced_analysis/getting_started)
