---
schema_version: "1"
id: dc10fce61612fde726e429b24b7f5e39d0ea449e16cd293395ff51cdb503bb6c
title: Facet Queries with Multiple Datasets
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_dashboards_steps_multidataset_facet.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_dashboards_steps_multidataset_facet.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 94e55281e9249a158ae770874f271a88950edc4623ff796f5bf8bd60bbb9a134
description: You can use a query with multiple datasets in a widget and then facet the query. The query receives filters from all of its datasets, but broadcasts selections from its first loaded dataset.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Facet Queries with Multiple Datasets

You can use a query with multiple datasets in a widget and then facet the query. The query receives filters from all of its datasets, but broadcasts selections from its first loaded dataset.

For example, suppose that the Opportunities dataset has the fields Account\_Owner, Region, and Amount. The Quota dataset has the fields Name and Quota.

```
quo = load "Quota";
opt = load "Opportunities";
att = cogroup opt by 'Account_Owner', quo by 'Employee';
att = foreach att generate opt.'Account_Owner' as 'Owner', sum(opt.'Amount')/sum(quo.'Quota') as 'percent attained', opt.Region as 'Region'.
```

A widget that uses this query receives filters for the following selections: A widget that uses this query broadcasts selections for Quota.Name and Quota.Quota.

- Opportunities.Name
- Opportunities.Amount
- Opportunities.Region
- Quota.Name
- Quota.Quota

#### See Also

- [Considerations for Queries with Multiple Datasets](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboards_steps_multidataset.htm&release=264.0.0&type=5 "When a query has multiple datasets, the query results are formatted using the XMD of the first loaded dataset. If the query is faceted, it receives filters for all of its datasets, but broadcasts selections only from its first loaded dataset.")