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, only the data from the query is exported. Any formatting you've applied to the query is not exported. When you export a query in Excel format, the query formatting is maintained.
You can also reload the query by clicking the Reload query button.
Reloading the query resubmits all of the query’s calculations behind the scenes, which can be useful when you’re manipulating especially complex or custom metrics. Additionally, reloading the query this way is faster than reloading the entire webpage and prevents you from losing any work that you haven’t yet saved.
Organizing your queries with tags
- Tickets: For any queries relating to tickets
- Articles: For any queries relating to article views
- Managers: For any queries created by the management team
This section contains the following topics:
Managing query tags
Before you can start using query tags, you'll need to set them up. You might find that some tags have already been created by others in your organization. You can use these as well as adding your own. Any Explore user with the Editor or Admin role can create tags. Additionally, you can control which tags appear in the queries library by pinning the ones you want.
To create tags
- In the Tags section of the queries library, click Manage.
- In the Manage tags panel, click New tag.
- Type a name for the tag and click Save.
- Repeat steps 2 and 3 to continue entering as many tag names as you want. When you're finished, click Done.
To delete or rename any of your query tags, click the options menu () next to the query tag you want to change.
To pin tags
- In the Manage tags panel, click the pin icon () next to any query tag you want to pin.
- When you're finished, click Done.
The tags you pinned will now always be visible in the queries library.
Adding tags to your queries
You add tags to your query in query builder. If you change your mind, you can always go back and edit them later.
To add tags to a query
- While editing a query, click the tags icon.
- In the Manage tags panel, select any tags you want to apply to the query.
- When you're finished, click Done.
Viewing queries by tag
Now that you've created query tags, you can begin to filter your list of queries in the library to show only the ones you want.
To filter your queries by tag
- In the Tags section of the queries library, click any tag.
Explore displays only the queries that contain the tag you chose.