> For the complete documentation index, see [llms.txt](https://docs.opendatablend.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opendatablend.io/open-data-blend-analytics/analytics-queries.md).

# Analytics Queries

In Open Data Blend Analytics, any query that is submitted as DAX or MDX is considered an Analytics Query.

## DAX Queries

[Data Analysis Expression (DAX)](https://docs.microsoft.com/en-us/dax/dax-overview) queries look like the following example.

```
DEFINE
    VAR __DS0Core =
        SUMMARIZECOLUMNS (
            'Anonymised MOT Test Result Info'[Test Postcode Area Name],
            "Anonymised_MOT_Test_Results", 'Calculation'[Anonymised MOT Test Results]
        )
    VAR __DS0PrimaryWindowed =
        TOPN (
            1001,
            __DS0Core,
            [Anonymised_MOT_Test_Results], 0,
            'Anonymised MOT Test Result Info'[Test Postcode Area Name], 1
        )
EVALUATE
__DS0PrimaryWindowed
ORDER BY
    [Anonymised_MOT_Test_Results] DESC,
    'Anonymised MOT Test Result Info'[Test Postcode Area Name]

```

Examples of client tools that can generate these queries are Power BI Desktop and Power BI Report Builder.

## MDX Queries

[Multidimensional Expression (MDX)](https://docs.microsoft.com/en-us/analysis-services/multidimensional-models/mdx/mdx-query-fundamentals-analysis-services?view=asallproducts-allversions) queries look like the following example.

```
SELECT {
         [Measures].[English Prescription Actual Cost],  
         [Measures].[English Prescription Items Total Quantity],  
         [Measures].[English Prescription Items],  
         [Measures].[English Prescription Quantity],  
         [Measures].[English Prescriptions]
       }, 
       NON EMPTY [Prescribing Practice].[Prescribing Practice Code (Source)].[Prescribing Practice Code (Source)].AllMembers ON ROWS 
FROM [Model]
```

Examples of client tools that can generate these queries are Excel and Tableau Desktop.

## Generated Queries

Client tools such as Excel, Power BI Desktop, and Tableau Desktop will typically generate one query per visualisation (e.g. charts, graphics, tables, etc). Placing too many visuals on a dashboard or report page can cause each refresh of a page display to send several queries to the Open Data Blend Analytics service. This should be considered when making dashboards and report design decisions, as it can reduce their responsiveness.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.opendatablend.io/open-data-blend-analytics/analytics-queries.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
