In this article, you'll learn how to perform various operations with existing Explore queries like saving, exporting, and cloning. If you are looking for information about how to create queries, see Creating queries. The operations you can perform on queries can be accessed from two places:
Working with queries in the queries library
The Queries library contains tools to help you manage and sort your queries. You open the queries library by clicking the () icon on the left sidebar. The query library navigation bar shows the following options.
- All queries: Displays all queries in your Explore instance.
- Favorites: Displays the queries you've marked as a favorite. To mark a query as a favorite, click the star icon next to a query name. Clear the star if you don't want the query to be a favorite any more.
- My queries: Displays only the queries that you created.
- Recently updated: Displays only the most recently created queries.
From the queries library, you can click the pull-down list next to any query to display the following options:
- Edit: Opens the selected query in the query editor.
- Clone: Creates an editable copy of the query. You can choose the dataset to which the query will be copied and give the copy a new name. Bear in mind that if the dataset you copy to doesn't support the metrics and attributes in your query, it won't work.
- Rename: Enables you to enter a new name for the query in the Name column of query builder. Alternatively, while you are in a query, you can give it a new name in the Query name text box above the Filters panel and then click Save.
- Delete: Deletes the query from the queries library. This option will not be selectable if you don't have permissions to access the query. For more details about permissions, see Setting editor and admin permissions. If you want to delete multiple queries, see Deleting multiple queries below.
Deleting multiple queries
In addition to deleting single queries, you can also delete multiple queries by using the procedure below.
To delete multiple queries
- In query builder, enable the checkbox next to each query you want to delete.
- Below the list of queries, click Delete.
- In the Delete query warning, click Yes, delete or No, cancel.
The selected queries are deleted.
Working with queries from within a query
In query builder, with a query open, click Save. From here, you can save, add the query to a new or existing dashboard, clone it, or export it.
- Save: Saves the current query. When you create or edit a query in Explore, the changes you make do not automatically save. You must save the query yourself.
Note: By default, your query will be named New query. Before you save it, you'll need to give it a new name in the Query name text box above the Filters panel.
- Add to dashboard: Adds your query to a new or existing dashboard. Your query will also be saved to the queries library. For more help, see Creating dashboards and Adding queries to dashboards.
- Save as new: Creates an editable copy of the query. You can choose the dataset to which the query will be copied and give the copy a new name. Bear in mind that if the dataset you copy to doesn't support the metrics and attributes in your query, it won't work.
- Export: Creates a CSV, image, PDF, or Excel file of your query. Exporting your query will not save it to the Queries library. When you export a query as CSV or Excel, only the data from the query is exported. Any formatting you've applied to the query is not exported.