Use * syntax for faster search

Table of Contents



Overview

This page explains how to:


Build a Query

Adding one or more fields to a query is the first step of building a query. Then, query fields can optionally be filtered, pivoted, or sorted.

Add a Field to a Query

To add a field to a query, do the following:

  1. Navigate to the Analytics page.

  2. In the Field Selection, click the name of a field once to add it to the query. Clicking the field a second time removes the field from the query.

The added field appears in two places:

  • In the Data section as a column. Dimensions appear as blue columns and measures appear as orange-brown columns.

  • In the In Use tab of the Field Selection. Dimensions appear as blue rows and measures appear as orange-brown rows.

Optional: Remove a Field from a Query

To remove a field from a query, do one of the following:

  • In the Field Selection, click the desired field.

  • In the Data section, click the gear icon in the column header of the desired field. Then, click Remove.


Optional: Add a Calculated Field to a Query

Calculated fields are user-created metrics and dimensions that are derived from one or more existing fields, including other calculated fields.

In the query results data table, located in the Data section, calculated fields appear as green columns.

To add a calculated field to a query, do the following:

  1. If the field(s) that the calculated field will be derived are not already part of the query, add the field(s) to the query.

  2. In the Data section, click the Add calculation button (see Analytics Page UI Elements, item 4).

  3. In the Create table calculation window, do the following:

    1. In the Expression field, enter the formula for how the calculated field should be derived. Calculated fields can be derived using basic mathematical operators—addition (+), subtraction (-), multiplication (*), division (/)—or built-in formulas.

    2. For Format, select the desired format option: Default formatting, ID, Decimals, U.S. Dollars, British Pounds, Euros, Percent, or Custom. For more information, see Calculated Field Format Options.


    3. For Name, enter a name for the calculated field.

    4. Optional: Click Add description and enter a description (up to 255 characters) for the calculated field. The text that is entered in the Description field is visible when the Info icon is clicked. The Info icon appears when hovering over the calculated field in the Field Selection.

    5. Click the Save button.


Optional: Pivot a Query

Pivoting a dimension can help make a data table with multiple dimensions easier to read, or provide a new perspective from which to look at results. When a dimension in a query is pivoted, each value in the dimension becomes a column in the resulting data table.

Only dimensions, and not measures, can be pivoted.

Pivot a Dimension in a Query

To pivot a dimension, do one of the following:

  • In the Field Selection, hover over the desired field. Then, click the Pivot data icon (see Field Selection Icons).

  • In the Data section, click the gear icon in the column header of the pivoted field. Then, click Pivot.

Unpivot a Dimension in a Query

To unpivot a dimension, do one of the following:

  • In the Field Selection, click the active Pivot data icon to the right of the field.

  • In the Data section, click the gear icon in the column header of the pivoted field. Then, click Unpivot.


Optional: Filter a Query

Filters provide a way to select a particular subset of data. A query can have multiple filters, and any field can be a filter, even if the field is not part of the query results.

Add a Filter to a Query

To add a filter to a query, do the following:

  1. Select a field to filter on by doing one of the following:

    • In the Field Selection, hover over the desired field. Then, click the Filter by field icon (see Field Selection Icons).

    • Click the Filters section to expand it, if it is not already expanded. Then, click the + Filter button and select a field.

    • In the Data section, click the gear icon in the column header of the desired field. Then, click Filter.

  2. Complete the filter options, which vary by the data type of the selected field. For example, a date field contains options such as within this date range, and a numeric field contains options such as is greater than this value.

Remove a Filter from a Query

To remove a filter from a query, do one of the following:

  • In the Field Selection, click the active Filter by field icon to the right of the dimension.

  • In the Filters section, click the X to the right of the filter.


Optional: Sort a Query

By default, the results of a query are sorted according to the following hierarchy:

  1. By the first date dimension, descending

  2. If there is no date dimension: By the first measure, descending

  3. If there is no date dimension or measure: By the first dimensions, ascending


However, it is possible to customize how a query is sorted.

Sort By a Single Field

A sorted field contains an arrow in the column header that indicates the sorting direction: pointed up for ascending order and pointed down for descending order.

To sort by a single field, do one of the following:

  • In the Data section, click the column header of the desired field once to sort in descending order.

  • In the Data section, click the column header of the desired field twice to sort in ascending order.

Sort By Multiple Fields

When sorting by multiple fields, the sorted fields contain a number in the column header to indicate the sorting order.

To sort by multiple fields, do the following in the Data section:

  1. Hold the Shift key.

  2. Select the desired column headers, in the desired order.

Run a Query

After a query is built, run the query to retrieve the requested information. Whenever a query is modified, like a new field is added or a filter is removed, re-run the query to refresh the retrieved results.

To run or re-run a query, click the Run button in the upper right corner of the screen.


Visualize a Query's Results

By default, query results are returned as a data table, but a query's results can be visualized in a variety of ways.

To create a visualization, do the following:

  1. Build and run a query.

  2. Click the Visualization section to expand it, if it is not already expanded.

  3. Select the desired type of visualization. Options include Table, Column, Bar, Scatterplot, Line, Area, and Pie. For more visualization options, click the ... icon.

  4. Click Edit to modify the visualization as desired, for example to relabel an axis or change how a data series is displayed.

Optional: Share a Query Before Saving

The results of a query can be shared immediately, without saving the query as a report or to a dashboard first.

To share a query, do the following:

  1. Build and run a query.

  2. Click the Explore actions gear icon in the upper right corner of the screen. Then, click Send.

  3. Choose one of the following options:

    1. To send the query as an email, follow steps 4 and 5 of Send a Report as an Email.

    2. To send the query to an Amazon S3 bucket, follow steps 4 and 5 of Send a Report to an Amazon S3 Bucket.

Save a Query

When saving a query, there are three options:

  • Save a query as a report: Save the query and any customizations, such as visualization options or sorted fields, as a report

  • Save a query as a new dashboard: Create a new dashboard and save the query as a query tile on the dashboard

  • Save a query to an existing dashboard: Select an existing dashboard and save the query as a query tile on the dashboard

Save a Query as a Report

To save a query as a report, do the following:

  1. Build and run a query.

  2. Click the gear icon in the upper right corner of the screen, next to the Run button.

  3. Hover over Save..., then click As a Look.

  4. In the Save Look window, do the following:

    1. For Title, enter a unique name for the report. If another report with the same name already exists, saving the current report will replace the previous report. Report names are case-insensitive.

    2. Optional: For Description, enter a description of the report.

    3. Select the folder to save the report in. Folder options depend on the user's access permissions.

  5. Choose one of the following options:

    • To save the report and return to the Analytics page, click Save.

    • To save the report and view the report, click Save & View Look.

    • To close the Save Look window without saving the report and return to the Analytics page, click the X at the upper right corner of the window.

Save a Query as a New Dashboard

To save a query as a new dashboard, do the following:

  1. Build and run a query.

  2. Click the gear icon in the upper right corner of the screen, next to the Run button.

  3. Hover over Save..., then click As a new dashboard.

  4. In the Save as a new dashboard window, do the following:

    1. For Title, enter a unique name for the dashboard and query tile. If another dashboard with the same name already exists, the current dashboard cannot be saved. Dashboard names are case-insensitive.

    2. For Settings, select the folder to save the dashboard in. Folder options depend on the user's access permissions.

    3. Optional: For Filters, select query filters to use as dashboard-level filters.

  5. Choose one of the following options:

    • To save the dashboard, click Save.

    • To close the Save as a new dashboard window without saving the dashboard, click Cancel or click the X at the upper right corner of the window.

Save a Query to an Existing Dashboard

To save a query to an existing dashboard, do the following:

  1. Build and run a query.

  2. Click the gear icon in the upper right corner of the screen, next to the Run button.

  3. Hover over Save..., then click To an existing dashboard.

  4. In the Add to a Dashboard in this folder window, do the following:

    1. For Title, enter a name for the new query tile.

    2. Select the folder that contains the desired dashboard.

    3. Select the dashboard to save the query tile to.

  5. Choose one of the following options:

    • To save the query as a tile in the selected dashboard, click Save to Dashboard.

    • To create a new dashboard and save the query to that dashboard, click New Dashboard and enter a name for the new dashboard. In the Add to a Dashboard in this folder window, select the newly created dashboard and click Save to Dashboard.

    • To close the Add to a Dashboard in this folder window without saving the query, click the X at the upper right corner of the window.
  • No labels
Provide feedback on this article