diff --git a/reporting-analytics/analytics.mdx b/reporting-analytics/analytics.mdx index 8461910..a284982 100644 --- a/reporting-analytics/analytics.mdx +++ b/reporting-analytics/analytics.mdx @@ -56,6 +56,30 @@ To configure a new chart based on an OpenOps table to display in the **Analytics For more information on how to create charts, see the [Superset documentation](https://superset.apache.org/docs/intro/). +## Creating virtual (SQL) datasets + +In the Analytics admin portal, a dataset can be created from: + +* A physical table or view (select it from the **Table** dropdown). +* A **virtual dataset**, defined by a SQL query. + +Create a virtual dataset in the Analytics admin portal by using the portal’s dataset creation flow and providing a SQL query. + +### Tips and best practices + +* Enter a non-empty SQL query. Creating a virtual dataset requires SQL that is not empty or whitespace. + +### Troubleshooting + +* **Dataset creation fails with an “SQL query cannot be empty or whitespace” error**: Edit the dataset and provide a SQL query with at least one non-whitespace character. + +## When a dataset already exists + +When creating datasets programmatically (for example, via internal services that call the analytics API), dataset creation can be configured to either: + +* **Reuse** an existing dataset when the dataset already exists. +* **Recreate** an existing dataset by deleting it first and then creating a new one (a delete-and-recreate flow). + ## Connecting to external data sources Here's what you can do to connect OpenOps Analytics to external data sources such as CSV files: