# Querying & Filtering Data

Rezonate has advanced query builder capabilities that allow filtering and sorting for all of the data that is being collected from different integrated platforms. This capability is supported across the entire product through the filters & search boxes that are placed above any table.

<figure><img src="https://2355086414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIkSba0W4HlnmPJ93gVOS%2Fuploads%2F86752q6iFr9QcGBdQX2u%2Fimage.png?alt=media&#x26;token=4d81794a-eb11-4748-86cb-f1ee2113bfbd" alt=""><figcaption><p>Query Builder example, Azure users page</p></figcaption></figure>

For example, if we are looking for all of the enabled user accounts with global admin directory roles who were active in the last week, we can write something like this:

<figure><img src="https://2355086414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIkSba0W4HlnmPJ93gVOS%2Fuploads%2FUx1ys40Rxri7G66UAOPl%2Fimage.png?alt=media&#x26;token=edba2aa7-deaf-4e5e-837e-3a091d0758d5" alt=""><figcaption><p>Query Builder Example #1 </p></figcaption></figure>

\
The Query builder has many operators that can be used, below is a detailed list of them and their purpose:

<figure><img src="https://2355086414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIkSba0W4HlnmPJ93gVOS%2Fuploads%2F9fDj1S8waWhz07W6wgta%2Fimage.png?alt=media&#x26;token=77db8fe2-08d8-4fa3-906d-a6c989ea9346" alt="" width="292"><figcaption><p>Example for Query term</p></figcaption></figure>

### Text Operators

<table><thead><tr><th width="140">Operator</th><th width="287">Purpose</th><th>Example</th></tr></thead><tbody><tr><td>starts with</td><td>Search for any text that starts with a specific text. (Insensitive)</td><td>Find all users whose name starts with Or (Will result in Ori, Oran, etc..)</td></tr><tr><td>contains</td><td>Search for any text that contains a specific text (Insensitive)</td><td>Find all users whose name contains Or (Will result in <strong>Or</strong>i, <strong>Or</strong>an, Li<strong>or,</strong> etc..)</td></tr><tr><td>not contains</td><td>Search for any text that not contains a specific pattern</td><td>Find all users whose names <strong>do not contain</strong> ABC.</td></tr><tr><td>equals</td><td>Search for any equal text (case-sensitive) to a specific text</td><td>Find all users with a first name equal to Ori. </td></tr><tr><td>not equals</td><td>Search for any text that is not equal (case-sensitive) to a specific text</td><td>Find all users with first names not equal to Ori. </td></tr></tbody></table>

<figure><img src="https://2355086414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIkSba0W4HlnmPJ93gVOS%2Fuploads%2FBgT8Sivf6yjEYlaUhldq%2Fimage.png?alt=media&#x26;token=9e404f18-3d78-4fb3-b13a-6b15aea7d1b9" alt="" width="361"><figcaption><p>Example for Query term</p></figcaption></figure>

### Date Operators

<table><thead><tr><th width="143">Operator</th><th width="287">Purpose</th><th>Example</th></tr></thead><tbody><tr><td>last</td><td>Search for dates that occurred <strong>within</strong> the selected relative date.</td><td><em>Find all users whose last login was <strong>within</strong> the last week.</em></td></tr><tr><td>before-last</td><td>Search for dates that occurred <strong>before</strong> the selected relative date. </td><td><em>Find all users whose last login was <strong>before</strong> the last week.</em></td></tr><tr><td>before</td><td>Search for dates that occurred <strong>before</strong> the selected date</td><td><em>Find all users whose last login was <strong>before</strong> 1/1/2024</em></td></tr><tr><td>after</td><td>Search for dates that occurred <strong>after</strong> the selected date</td><td><em>Find all users whose last login was <strong>after</strong> 1/1/2024</em></td></tr></tbody></table>

{% hint style="success" %}
Pro Tip! - When saving searches in the query catalog, its always preferred to use relative date operators such as last or before-last.
{% endhint %}

### Boolean Operators

<table><thead><tr><th width="143">Operator</th><th width="287">Purpose</th><th>Example</th></tr></thead><tbody><tr><td>is</td><td>Find a matching value for the boolean</td><td><em>Find all users with <strong>enabled</strong> account. (<strong>Enabled</strong> is <strong>true</strong>)</em></td></tr></tbody></table>

### Number Operators

<table><thead><tr><th width="149">Operator</th><th width="287">Purpose</th><th>Example</th></tr></thead><tbody><tr><td>Bigger Than</td><td>Find records with a number bigger than the searched input</td><td><em>Find all users with age>10</em></td></tr><tr><td>Smaller Than</td><td>Find records with a number smaller than the searched input</td><td><em>Find all users with age&#x3C;10</em></td></tr><tr><td>Equals</td><td>Find records with a number equal to a selected input</td><td>Find all users with age=10</td></tr><tr><td>Not Equals</td><td>Find records with a number not equal to a selected input</td><td>Find all users with age!=10</td></tr></tbody></table>

### Filters Combinations

When combining **multiple filters** on the **same** **field**, the resulting query term would apply <mark style="background-color:green;">**AND**</mark> criteria between them. this means that when searching for Name contains "Ori" and Name contains "Levy" the compiled search would be&#x20;

```
Name contains "Ori" AND Name contains "Levy"
```

#### Special Cases

Although the regular behavior, when combining multiple <mark style="background-color:yellow;">**Equals**</mark> filters on the same field, Rezonate will compile them with <mark style="background-color:green;">**OR**</mark> Operator. this means that when searching for Name equals "Ori", and Name equals "Ron" the compiled search would be &#x20;

```
Name equals "Ori" OR Name equals "Ron"
```
