---
schema_version: "1"
id: 2a1dcd0deed638db0ac51db76dbcee3e88035fb336686df48f7c371d354a6ebd
title: Bind Queries from Different Datasets
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_bindings/guides/bi-dashboard-bindings-wave-designer-different-datasets.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-different-datasets.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e6c181539ca0675139c1753074d442f39f7ff8eb568cc4496d4be7a2bf34211f
products:
  - Analytics Interactions
  - analytics
---
# Bind Queries from Different Datasets

You can bind queries from different datasets. For example, this dashboard contains two charts, each based on its own dataset.

![The dashboard shows two charts, each based on a different dataset.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_2_charts_2_datasets.png)

When a selection is made in the Opportunities DS chart, that selection also filters the SalesOpp DS chart because of a selection interaction. The `filters` attribute of the `Country_1` query contains a selection interaction based on the `Account_BillingCount_1` query.

Here’s the full dashboard JSON for the queries and chart widgets, which contains the `{{column(Account_BillingCount_1.selection, [\\"Account.BillingCountry\\"]).asObject()}}` selection interaction described previously.

```json
{
    "label": "Cross-Dataset Bindings",
    "state": {
        "gridLayouts": [...],
        "layouts": [],
        "steps": {
            "Account_BillingCount_1": {
                "datasets": [
                    {
                        "id": "0Fbx000000000LzCAI",
                        "label": "Opportunities",
                        "name": "opportunity1",
                        "url": "/services/data/v38.0/wave/datasets/0Fbx000000000LzCAI"
                    }
                ],
                "isFacet": true,
                "isGlobal": false,
                "query": {
                    "measures": [
                        [
                            "count",
                            "*"
                        ]
                    ],
                    "groups": [
                        "Account.BillingCountry"
                    ]
                },
                "type": "aggregateflex",
                "useGlobal": true,
                "visualizationParameters": {
                    "visualizationType": "hbar",
                    "options": {}
                }
            },
            "Country_1": {
                "datasets": [
                    {
                        "id": "0Fbx000000000NACAY",
                        "label": "SalesOpps",
                        "name": "SalesOpps",
                        "url": "/services/data/v38.0/wave/datasets/0Fbx000000000NACAY"
                    }
                ],
                "isFacet": true,
                "isGlobal": false,
                "query": {
                    "measures": [
                        [
                            "count",
                            "*"
                        ]
                    ],
                    "groups": [
                        "Country"
                    ],
                    "filters": [
                        [
                            "Country",
                            "{{column(Account_BillingCount_1.selection, [\\"Account.BillingCountry\\"]).asObject()}}"
                        ]
                    ]
                },
                "type": "aggregateflex",
                "useGlobal": true,
                "visualizationParameters": {
                    "visualizationType": "hbar",
                    "options": {}
                }
            }
        },
        "widgetStyle": {...},
        "widgets": {
            "text_1": {
                "parameters": {
                    "fontSize": 20,
                    "text": "Opportunities DS",
                    "textAlignment": "center",
                    "textColor": "#000000"
                },
                "type": "text"
            },
            "text_2": {
                "parameters": {
                    "fontSize": 20,
                    "text": "SalesOpp DS",
                    "textAlignment": "center",
                    "textColor": "#000000"
                },
                "type": "text"
            },
            "chart_2": {
                "parameters": {
                    "legend": {
                        "showHeader": true,
                        "show": true,
                        "position": "right-top",
                        "inside": false
                    },
                    "showMeasureTitle": true,
                    "showTotal": true,
                    "visualizationType": "pie",
                    "step": "Country_1",
                    "exploreLink": true,
                    "inner": 70,
                    "title": {
                        "label": "",
                        "subtitleLabel": "",
                        "align": "center"
                    },
                    "theme": "wave",
                    "trellis": {
                        "enable": false,
                        "type": "x",
                        "chartsPerLine": 4
                    }
                },
                "type": "chart"
            },
            "chart_1": {
                "parameters": {
                    "legend": {
                        "showHeader": true,
                        "show": true,
                        "position": "right-top",
                        "inside": false
                    },
                    "showMeasureTitle": true,
                    "showTotal": true,
                    "visualizationType": "pie",
                    "step": "Account_BillingCount_1",
                    "exploreLink": true,
                    "inner": 70,
                    "title": {
                        "label": "",
                        "subtitleLabel": "",
                        "align": "center"
                    },
                    "theme": "wave",
                    "trellis": {
                        "enable": false,
                        "type": "x",
                        "chartsPerLine": 4
                    }
                },
                "type": "chart"
            }
        }
    },
    "datasets": [
        {
            "id": "0Fbx000000000LzCAI",
            "label": "Opportunities",
            "name": "opportunity1",
            "url": "/services/data/v38.0/wave/datasets/0Fbx000000000LzCAI"
        },
        {
            "id": "0Fbx000000000NACAY",
            "label": "SalesOpps",
            "name": "SalesOpps",
            "url": "/services/data/v38.0/wave/datasets/0Fbx000000000NACAY"
        }
    ]
}
```
