---
title: "Data Studio"
canonical_url: "https://docs.getdx.com/data-studio/"
md_url: "https://docs.getdx.com/data-studio.md"
last_updated: "2026-06-18"
---

# Data Studio
Data Studio is a powerful PostgreSQL query and data visualization tool that lets you explore your engineering data, create custom reports, and share insights with your team.

Common use cases for Data Studio include:

- **Custom reporting:** Build tailored reports and dashboards beyond the standard DX views to answer specific questions about your engineering metrics.
- **Data exploration:** Query your raw engineering data directly using SQL to uncover patterns, trends, and insights unique to your organization.
- **AI-powered analysis:** Use the built-in AI assistant to generate queries and visualizations based on natural language requests, making data analysis accessible to non-technical team members.
- **Team collaboration:** Save and share queries with teammates, enabling collaborative data analysis and consistent reporting across your organization.
- **Real-time data access:** Connect external tools like Google Sheets to your data through datafeeds for live reporting and analysis.

## Getting started

Data Studio provides a complete query editor with rich schema documentation to help you understand your available data. You can write SQL queries directly or use the AI assistant to generate queries based on natural language requests.

## AI assistant

The AI assistant understands your entire DX dataset and can help generate SQL queries, create visualizations, and provide insights about your engineering data. Simply describe what you want to analyze in natural language, and the AI will generate the appropriate SQL query.

![AI Chat Example](https://docs.getdx.com/assets/images/data_studio/ai_chat_example.png)

The AI assistant has full context about your data schema and can help you:

- Generate complex SQL queries from natural language requests
- Suggest relevant visualizations for your data
- Provide insights and explanations about your results
- Help optimize query performance

## Query editor

The query editor provides a full SQL interface with syntax highlighting, autocomplete, and schema browsing. You can write queries directly against your engineering data and see results in real-time.

![Query Editor](https://docs.getdx.com/assets/images/data_studio/query_editor.png)

Features include:

- **Schema browser:** Explore all available tables and columns with detailed documentation
- **Query history:** Access previously run queries and saved queries
- **Syntax highlighting:** Full SQL syntax support with error detection
- **Autocomplete:** Smart suggestions for table names, columns, and SQL keywords
- **Template variables:** Create dynamic queries using `$variable_name` syntax for interactive parameters

### Template variables

Template variables allow you to create dynamic, reusable queries by adding input parameters. Use the `$` prefix to define variables in your SQL queries, and Data Studio will automatically generate input fields for each variable.

For example, in a query like:

```sql
SELECT * FROM github_pulls
WHERE repo_name = $repo_name
LIMIT 10;
```

Using `$repo_name` in your query will create a `repo_name` input field that users can fill in to filter results dynamically. This makes queries more flexible and enables self-service data exploration for your team members.

### CSV export

Export query results as CSV files for use in external tools or further analysis. This is useful for:

- Creating reports in other tools
- Sharing data with stakeholders
- Archiving analysis results

### Visualization

Transform your query results into compelling visualizations with built-in charting capabilities. Data Studio supports various chart types including:

- Tables for detailed data views
- Pie charts for proportional data
- Bar charts for comparisons
- Line charts for trends over time
- Scatter charts for plotting correlated data

### Datafeeds

Connect your DX data to external tools through datafeeds, which provide real-time CSV access to your query results. This enables:

- **Google Sheets integration:** Import live data directly into spreadsheets using the provided datafeed URL
- **External dashboards:** Connect BI tools to your DX data for advanced reporting
- **Automated reporting:** Use datafeeds in scripts and automated workflows

To use a datafeed:

1. Run and save your query in Data Studio
2. Copy the provided datafeed URL from the share menu
3. Use the URL in external tools like Google Sheets with the `=IMPORTDATA()` function
4. For more flexibility; use the [queries.datafeed](https://docs.getdx.com/webapi/methods/queries.datafeed) API method to display data in any format and embed the data in any system you'd like.

### Saved query referencing

Saved query references allow you to build modular, reusable queries by referencing other saved queries as subqueries. This enables you to create complex analyses by composing smaller, well-tested query building blocks.

Reference a saved query using the `$query_<id>` syntax, where `<id>` is the unique identifier of the saved query:

```sql
-- Reference a saved query that returns active users
SELECT name, email FROM $query_abc123
WHERE created_at > '2024-01-01'
```

When the query executes, the reference is replaced with the saved query's SQL wrapped in parentheses, making it a valid subquery.

To reference a saved query:

1. Open the saved queries panel in the query editor
2. Find the query you want to reference
3. Click the menu icon (three dots) next to the query name
4. Select **Copy as subquery** to copy the reference to your clipboard
5. Paste the reference into your query

When referencing saved queries, the following limitations apply:

- **Maximum nesting depth**: Queries can be nested up to 5 levels deep. Exceeding this limit will result in an error.
- **Circular references**: A query cannot reference itself, either directly or through a chain of other queries. Data Studio validates for circular references when you save a query.
- **Access control**: You can only reference:
  - Public saved queries (visible to your entire account)
  - Private saved queries that you own
- You cannot reference another user's private queries.

## Backstage charts

Integrate DX data directly into your Backstage service catalog using the `DxDataChartCard` component from the [@get-dx/backstage-plugin](https://github.com/get-dx/backstage-plugin/). This allows you to display Data Studio query results as charts within your Backstage service pages.

![Backstage DORA Charts Demo](https://docs.getdx.com/assets/images/data_studio/backstage_charts.png)

### Setup

1. Install the DX Backstage plugin in your Backstage instance
2. Create and save a query in Data Studio
3. Copy the datafeed token from the query's share menu
4. Add the `DxDataChartCard` component to your Backstage service page

### Usage

The `DxDataChartCard` component displays saved Data Studio queries as charts within Backstage:



```tsx
import { DxDataChartCard } from "@get-dx/backstage-plugin";

function MyDashboard() {
  const { entity } = useEntity();

  return (
    <DxDataChartCard
      title="Deployment Frequency"
      description="Weekly deployments over time"
      datafeedToken="your-datafeed-token"
      unit="deployments"
      variables={{
        teamId: entity.metadata.annotations?.["getdx.com/id"],
      }}
      chartConfig={{
        type: "line",
        xAxis: "date",
        yAxis: "count",
      }}
    />
  );
}
```



## Custom reports

Custom reports allow you to save queries and chart configurations as reusable tiles that can be displayed on dedicated report pages. These reports provide a powerful way to create personalized dashboards and share insights with your team.

![Custom reports example with Copilot usage](https://docs.getdx.com/assets/images/data_studio/custom_report_example.png)

### Key features

- **Tiles:** Save query and chart combinations as resizable, reorderable tiles
- **Sections:** Organize tiles into sections that can also be reordered
- **Markdown notes:** Add notes at the top of reports with full markdown support
- **Flexible layout:** Resize and arrange tiles to create the perfect dashboard layout

### Access control

Custom reports include robust visibility and access settings:

- **Edit permissions:** Control who can modify the custom report
- **Individual access:** Grant access to specific team members
- **Account visibility:** Choose whether the report is visible to your entire account or kept private

### Variables

Custom reports support dynamic filtering through variables, making your reports interactive and adaptable. When you enable variables on a report, users can select filter values from dropdowns, and those selections are automatically substituted into your SQL queries.

Variables use a simple substitution syntax: place the variable name (prefixed with `$`) anywhere in your SQL query. When the report runs, the system replaces the variable with the selected values.

For example, a query could be written using the `$team_ids`, `$start_date`, and `$end_date` variables to count merged PRs per developer:

```sql
SELECT
    dx_users.name AS developer,
    COUNT(*) AS pull_requests_merged
FROM pull_requests
JOIN dx_users ON dx_users.id = pull_requests.dx_user_id
JOIN dx_teams ON dx_teams.id = dx_users.team_id
WHERE dx_teams.id IN ($team_ids)
    AND pull_requests.merged BETWEEN $start_date AND $end_date
    AND pull_requests.deleted IS NOT TRUE
GROUP BY dx_users.name
ORDER BY pull_requests_merged DESC
```

#### Built-in variables

- `$service_ids` - Filter by specific services
- `$team_ids` - Filter by team assignments
- `$user_ids` - Filter by individual users
- `$start_date` and `$end_date` - Date range filtering

#### Custom variables

Create your own variables by providing:

- **Title:** Display name for the variable
- **Variable name:** Reference name for use in queries (e.g., `$my_variable`)
- **Description:** Help text explaining the variable's purpose
- **SQL statement:** Query to populate dropdown options

Custom variable SQL queries must return exactly two columns:

- `value` - The actual value used in the query
- `label` - The display text shown to users

Variables can be referenced in any query within the custom report using the `$variable_name` syntax, enabling dynamic filtering and personalized data views.
---

## Sitemap

[Overview of all docs pages](/llms.txt)
