Create a Metric using Custom SQL
This guide provides a step-by-step approach to utilizing custom SQL for creating metrics, which can enhance your data analysis capabilities.
Last updated
This guide provides a step-by-step approach to utilizing custom SQL for creating metrics, which can enhance your data analysis capabilities.
Last updated
Access Custom SQL
In the create metric page, select "Custom Query" option.
Click the "Write Query" button to open the query editor.
Query Execution
Write your custom SQL query in the editor.
Use the "Format Query" button to automatically format your SQL code for readability.
If needed, click the "Format query with AI" button to automatically convert your SQL query into the DataBrain's preferred format.
After reviewing, click "Run Query" to execute your query.
View the chart
Once your query is executed, a chart will display your results.
You can choose between different chart types, depending on your analysis preferences.
Preview
To preview the raw SQL data, click on the Preview icon located near the table name.
This will display the SQL query results in a tabular format, where you can use features like search, sort, and pagination to analyze the data further.
Edit Custom query
To make adjustments to the query, click on the "Edit" icon.
Modify your custom SQL query and then re-execute it to see the changes reflected in the results.