How to use Databricks data in TheyDo
Once your Databricks integration is connected, you can create metrics that pull data from your Databricks tables using SQL queries.
Overview
Databricks metrics in TheyDo are query-based. You write a SQL query that returns the data for your metric, and TheyDo fetches and displays it. You can use these metrics in journey steps or add them to your Metrics Library.
Creating a metric from Databricks
- Open a journey and select Add a metric, or go to the Metrics Library and select + Metric.
- Choose Databricks as the data source.
- Select the warehouse to connect to.
- Choose the metric type (CSAT, CES, NPS, RATIO, or Other).
- Enter a name for the metric.
- Write your SQL query using your connected Databricks table.
- Click Save and run — TheyDo will fetch the data and display it.
Note: If no data is available in the last 30 days, click Show latest data to retrieve the most recent available data points.
SQL query requirements
Your query must return the columns required for your metric type:
| Metric type | Required columns |
|---|---|
| CSAT | date, positives, negatives, respondents |
| CES | date, respondents, value |
| NPS | date, detractors, promoters, respondents |
| RATIO | date, numerator, denominator |
| OTHER | date, value |
If your Databricks table uses different column names, use SQL aliasing:
SELECT det AS detractors, prom AS promoters, resp AS respondents, dt AS date FROM my_catalog.my_schema.nps_table
Tips
- Work with your data team to prepare and validate queries before setting up metrics.
- If you have multiple Databricks instances connected, make sure to select the correct one.
- For PrivateLink or advanced setup questions, reach out to support.