Skip to content

Custom queries

ChartFactor Studio allows you to define SQL queries and name them. ChartFactor then treats these queries as any other table or view where users can perform aggregations to visualize their data. Please refer to the Custom Queries page of the Toolkit documentation for a full description of this feature.

ChartFactor Studio supports custom queries for Databricks, SparkSQL, Google BigQuery, Redshift, Postgres, and Snowflake between others. Please refer to the Providers Capabilities Summary page for a full list.

Creating a new query

To create a custom query, select the blue button on the lower right corner of your application page to open the Data Providers dialog. Then, select your data provider and open the Custom Queries section.

custom queries menu

You should now have the Custom Queries dialog open. To add new custom query, select the plus "+" button located on the top right corner of the Custom Queries dialog.

custom queries list

This opens a window to create a Custom Query as shown below.

new custom query

Type the name of your query and then your SQL query. After this, you can click on the Execute button to run it. If everything goes well, you should see the results in a table like this:

executed query

Info

You can resize the query dialog by dragging its bottom right corner

If there are errors caused by a wrong SQL query or any other reason, the error is printed in the results area. In the example below, catgroup was mistyped to catgroupp to render an error message. You can expand or collapse the results window by clicking on the caret down icon above the results area in case you'd like to have more room to edit your query.

executed query error

You can save your query by clicking on the Save button. After that, your query will be listed under the Custom Queries menu:

new query created

Editing a custom query

You can edit existing queries by clicking the pencil icon near the query name. A window will open where you can modify your query.

To preview the query results of an existing query, click the Execute button again.

Deleting a custom query

To delete a query, click on the pencil icon and then click the Delete button. A confirmation message will appear. Confirm if you'd like to proceed with the deletion.