---
title: "Filtering report results"
canonical: "https://support.appfire.com/space/RFC/477332946/Filtering%20report%20results"
format: markdown
---
> Macro (aura-html)

Reporting Cloud app lets you filter your report results in two ways.

## Filtering your raw fetched results

<span style="color: #0e101a">You can use CQL (Confluence Query Language) in the </span><span style="color: #0e101a">*Query *</span><span style="color: #0e101a">section as a starting point to filter results. </span>

![81e28ac5-f35c-408e-83e3-ca32607336b9.png](media://89de7833-b740-44f9-b2c1-e2256418f8d0)

<span style="color: #0e101a">Here are some example queries:</span>

| ** Query  result** | **CQL** |
| --- | --- |
| Matches all pages within the *KBASE *space. | `type=page and space="KBASE"` |
| Matches all pages within the current space. | `type=page and space=currentSpace()` |
| Matches all comments within the *KBASE *space and on the current page. | `type=page and space=currentSpace() and content=currentPage()` |
| Matches all pages with the label *profile_page*. | `type=page and label="profile_page"` |
| Matches all pages created by the current user. | `type=page and creator=currentUser()` |
| Matches all pages with the label *profile_page* that were modified after the start of this year. | `type=page and label="profile_page" and lastModified > startOfYear()` |

CQL, which is similar to JQL, is a complete query language, which lets you filter your query data in various ways. You can refer to [Atlassian's CQL documentation](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/) for a comprehensive guide.

> ℹ️ Development teams introduced `currentPage()` and `currentSpace()` specifically for Reporting Cloud. They are not available as a generic CQL queries.

> ⚠️ ### Fetching all results
> ⚠️ 
> ⚠️ By default, Reporting will only return the first 200 results from a query. This is done for performance reasons. There is a **Fetch all results** option below the query box, but be aware that it may significantly increase reports' loading times if you enable this.
> ⚠️ 
> ⚠️ ![c345fc90-f3af-4951-a41d-c207678e3b62.png](media://e6103033-782a-4cb2-98c5-de0962054ce3)

## Auto-complete CQL queries

Reporting includes an auto-complete feature to help you build usable CQL queries. You can click in the query box and select the suggested query terms from the dropdown.

See the CQL query example below on generating a report on all the pages in the current space, ordered by the last modified date. 

```
type=page AND space=currentSpace() order by lastmodified
```

You could type the whole query or use the auto-complete feature, as shown below.

![image](media://a72d05be-241f-4281-9b3b-cca789eb098b)

![image](media://567ce1c9-d417-421a-ac02-fd452456d8ff)

## Advanced filtering for your final report results

<span style="color: #0e101a">Reporting lets you apply advanced filters using</span> [ ](https://jmespath.org/)<span style="color: #4a6ee0">[JMESPath](https://jmespath.org/)</span><span style="color: #0e101a">. JMESPath is a JSON manipulation tool that will enable you to transform and filter results to provide better control over the final results and how they are formatted and shown on your report. </span>

<span style="color: #0e101a">To add a JMESPath filter, go to the </span><span style="color: #0e101a">*Filters *</span><span style="color: #0e101a">section and click </span><span style="color: #0e101a">**Add**</span><span style="color: #0e101a">. Enter manually or paste the JMESPath string. You can also add more than one filter, and filters are applied from top to bottom. </span>

<span style="color: #0e101a">You can change the order of filters by dragging them up or down. Then click </span><span style="color: #0e101a">**Apply**</span><span style="color: #0e101a"> to use the filters.</span>

<span style="color: #0e101a">In the following example, two filters are applied.</span>

![image](media://41221bb1-b663-4b1f-88ff-897f19d07e87)

<span style="color: #0e101a">JMESPath is geared towards more advanced users and requires report builders to understand and familiarize themselves with the syntax. We have documented a few commonly used filters below.</span>

| **Filter result** | <span style="color: #0e101a">**JMESPath **</span> |
| --- | --- |
| Show only the first five results. | `[:5]` |
| Only display the second result from the return CQL. | `[[1]]` |
| The result should match the exact title of *Product catalog.* | `[?content.title=='Product catalog']` |
| The title should start with the word *Product*. | `[?starts_with(content.title, 'Product')]` |
| The content body must contain the text *Product.*<br>Make sure **body.storage** is added to your expansions. | `[?contains(content.body.storage.value, 'Product')]` |