# Custom queries and reference for the Audience with Attributes Explore

Use the Audience with Attributes Explore to understand the state of your audience by evaluating device and user data.

You can view your users' current and past [Device Properties](https://www.airship.com/docs/reference/glossary/#device_properties), [Tags](https://www.airship.com/docs/reference/glossary/#tag), and [Attributes](https://www.airship.com/docs/reference/glossary/#attributes).

<p>Data availability depends on your <a href="https://www.airship.com/docs/reference/feature-packages/#data">Performance Analytics plan</a>.</p>

## Navigation

To access to the Explore:

1. Go to **Reports**, then **Performance Analytics**.
1. Select the folder icon (
), then **Shared**.
1. Under **Looks**, select **Explore Glossary** (**Explore Glossary EUCS** for EU customers).
1. Select **Audience with Attributes**, then **Navigate to Explore**.

<p>For a list of all Explores in the glossary, see <a href="https://www.airship.com/docs/guides/reports/analytics/exploring/exploring/#predefined-explores">Predefined Explores</a> in <em>Exploring Performance Analytics data</em>.</p>

## Field categories

<p>The sidebar lists categories for various filters, [Dimensions](https://www.airship.com/docs/reference/glossary/#pa_dimension), and [Measures](https://www.airship.com/docs/reference/glossary/#pa_measure) you can use to explore your data. To see their definitions, hover over an item, then select the &ldquo;i&rdquo; icon (
).</p>

Field categories in the Audience with Attributes Explore:

<div class="table-scroll-wrapper">
<table width="100%" class="reference-table">
  <col style="width:20%">
  <col style="width:80%">
<thead>
  <tr>
    <th>Category</th>
    <th>Description</th>
   </tr>
</thead>
<tbody>
  <tr>
    <td>Attributes</td>
    <td>Set Attribute parameters for the query.</td>
  </tr>
  <tr>
    <td>Device Properties</td>
    <td>Get device property values associated with the channels at the time the report is run.</td>
  </tr>
  <tr><td>Query Parameters</td>
<td>Target all or specific projects, and specify dates and response windows, where relevant.</td></tr>
  <tr>
    <td>Report Over Time</td>
    <td>Add filters and Dimensions to report historical data.</td>
  </tr>
  <tr>
    <td>Tags</td>
    <td>Get Tag values associated with the channels at the time the report is run.</td>
  </tr>
  <tr><td>User Detail</td>
<td>Get information about the channel that performed the filtered event.</td></tr>
</tbody>
</table>
</div>

<!--

The definition for "Device Properties" here is the same as "Device Properties Current" in other Explores. It just has a different name in this one.

The definition for "Tags" here is the same as "Tags Current" in other Explores. It just has a different name in this one.

-->

### Default filters

<p>Use filters to reduce the number of records scanned and results returned. Each Explore includes filters that cannot be removed from the query.</p>

The filter name, [field category](#field-categories), and usage information for the default filters in the Audience with Attributes Explore:

<div class="table-scroll-wrapper">
<table width="100%" class="reference-table">
  <col style="width:20%">
  <col style="width:20%">
  <col style="width:60%">
<thead>
  <tr>
    <th>Filter name</th>
    <th>Field category</th>
    <th>Use the filter to...</th>
  </tr>
</thead>
<tbody>
  <tr><td>Current Project Only</td>
<td>Query Parameters</td>
<td>
  Determine which projects are included in the query. Default selection: <b>Yes</b>. To include other projects within your company, select <b>No</b>, then:
    <ol>
      <li>
        In the sidebar, select <b>Query Parameters</b>.
      </li>
      <li>
        Under <b>Dimensions</b>, select the filter icon (
) next to <b>Project name</b>.
      </li>
      <li>In the Filters section, select the entry field next to the Project Name filter and choose which projects to include.
      </li>
    </ol>
</td></tr>
  <tr>
    <td>Current Audience Only</td>
    <td>Report Over Time</td>
    <td>Determine whether or not to return your audience's current values only. Default selection: <b>Yes</b>. Select <b>No</b> to also return historical values.</td>
  </tr>
</tbody>
</table>
</div>

## Building custom queries

The following sections walk you through using the Audience with Attributes Explore to create custom queries that answer:

* How many mobile users can I reach with a [Push Notification](https://www.airship.com/docs/reference/glossary/#push_notification)? And how many with Email or SMS? Is my audience growing?
* Within a [Tag Group](https://www.airship.com/docs/reference/glossary/#tag_group), which Tag do users subscribe to the most? Among these users, how many opted out of push notifications?

### Determine audience reach and growth

Follow these steps to view historical user counts you can use to analyze your audience evolution. You can filter by Tag, Attribute, or Device Property. In our example, we add the Device Property Filter for notification opt-ins. User counts are listed per platform.

First, [open the Audience with Attributes explore](#navigation), and then configure your query:

1. Set up the filters:
   1. Leave **Current Project Only** set to `is Yes`.
   1. Set **Current Audience Only** to `is No`.
   1. In the sidebar, select **Report Over Time**, then the filters **Number of Days, Weeks or Months to Report** and **Report over time by Day, Week, or Month**.
      > **Tip:** Instead of navigating to filters, Dimensions, and Measures, you can find them using the search box at the top of the sidebar.
   1. Set the **Number of...** and **Report over time...** filters to the period of time you want to query.
   1. In the sidebar, select **Device Properties**, then **Notification Opt-in Filter**.
   1. Set **Notification Opt-in Filter** to `is not null`.

1. ![Selecting the option to pivot data](https://www.airship.com/docs/images/explore-pivot-data-aa_hu_5eb4e4ac20f19c6c.webp)

*Selecting the option to pivot data*

In the sidebar, specify the values and measurement to display:
   1. Select **Report Over Time**, then select the Dimension **Date** or **Month**. Our example uses **Date**.
   1. Select **User Detail**, then select the Dimension **Platform**, then select the double-arrow icon next to **Platform**. The pivot option adds detailed metrics for each platform and makes it more readable. It can be helpful when using the Graph visualization.
   1. Select **User Detail**, then select the Measure **User Count**.

<p>Now you are ready to get your data. Select <strong>Run</strong>, and you should see results similar to the below image. To save your custom query for later access, follow the steps in <a href="https://www.airship.com/docs/guides/reports/analytics/tasks-queries/saving-queries/">Saving Performance Analytics queries</a>.</p>

![Creating a custom query from the Audience with Attributes Explore](https://www.airship.com/docs/images/explore-audience-reach_hu_d1f0a6736899cd11.webp)

*Creating a custom query from the Audience with Attributes Explore*

<!--To do: Replace image ^^ with one that shows all the filters.-->

### Find Tags and opt-outs

Follow these steps to find which Tags in a Tag Group users subscribe to the most and how many opted out of push notifications.

First, [open the Audience with Attributes explore](#navigation), and then configure your query:

1. Set up the filters:
   1. Leave **Current Project Only** set to `is Yes`.
   1. Leave **Current Audience Only** set to `is Yes`.
   1. In the sidebar, select **Device Properties**, then **Notification Opt-in Filter**.
   1. Set **Notification Opt-in Filter** to `is not null`.
   1. In the sidebar, select **Tags**, then **#1 Tag Group Filter**. Then set it to `is equal to` and enter the name of the Tag Group you want to return Tags for.
   1. (Optional, to return specific tags in the filtered Tag Group) In the sidebar, select **Tags**, then **#1 Tag Name Filter**. Then set it to `is equal to` and enter the names of Tags in the Tag Group.

1. In the sidebar, specify values and measurements to display:
   1. Select **Tags**, then select the Dimensions **#1 Tag Group** and **#1 Tag Name**.
   1. Select **User Detail**, then select the Measure **User Count**. 
   1. ![Selecting the option to pivot data](https://www.airship.com/docs/images/explore-pivot-data_hu_7acb2794baf8f83d.webp)

*Selecting the option to pivot data*

Select **Device Properties**, then select the Dimension **Notification Opt-in**, then select the double-arrow icon next to **Notification Opt-in**. The pivot option adds detailed metrics for each platform and makes it more readable.

1. In the **Data** header, select the **Row Totals** check box to display the sum of opted in and opted out channels that have each Tag. 

<p>Now you are ready to get your data. Select <strong>Run</strong>, and you should see results similar to the below image. To save your custom query for later access, follow the steps in <a href="https://www.airship.com/docs/guides/reports/analytics/tasks-queries/saving-queries/">Saving Performance Analytics queries</a>.</p>

![Creating a custom query from the Audience with Attributes Explore](https://www.airship.com/docs/images/explore-audience-tags_hu_1f276a51dc7ff982.webp)

*Creating a custom query from the Audience with Attributes Explore*