> For the complete documentation index, see [llms.txt](https://docs.silverband.com.au/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.silverband.com.au/home/paradigm-knowledge-base/generating-reports/workflows/introduction-to-report-builder/logical-operators-and-or-or.md).

# Logical Operators AND | OR

This page will provide a description and examples for each Logical Operator that you can use in Report Builder

## **Overview** <a href="#and" id="and"></a>

Each filter clause that you have added needs to be joined to the next set of filter clauses by using the AND and OR logical operators. If you want both filter clauses to be true, you use AND, else use OR.

Following the previous example from the [Basic Comparison Operators](/home/paradigm-knowledge-base/generating-reports/workflows/introduction-to-report-builder/basic-comparison-operators.md) page, using a [Course Enrolment Base Report](/home/paradigm-knowledge-base/generating-reports/workflows/introduction-to-report-builder/base-reports.md#student-course-enrolment-details) limiting the results to a (1) specific start date, (2) only students who are enrolled on a specific Course, and (3) only output records that are "Enrolled". If you want to make ALL three conditions to be true in the results of your output - you add the **AND** condition to the three of them.&#x20;

To demonstrate the **OR** condition as part of the example above, let's say you want to add more filters on the students' "Country" and "Citizenship" information. The results should also check if the students have a Country **OR** Citizenship record as "**Australia**". Adding these filters will further down your results to students with a "Country" **OR** "Citizenship" as "Australia".

<img src="https://1246578764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC21t2SaV2eKaLxvtR27D%2Fuploads%2FUhT7DRH09JCoZHheTht3%2Ffile.drawing.svg?alt=media&amp;token=e8cee6f2-0a57-4fc4-840b-7a3912f38620" alt="Filter Clauses joined by the Logical Operators AND and OR" class="gitbook-drawing">

How to do it in Paradigm using the Report Builder menu?

In building your report, you can add the logical operators under the FILTER CLAUSES section by using the **AND SET** or **OR SET** menus, in continuation with entering your [Basic Comparison Operators](/home/paradigm-knowledge-base/generating-reports/workflows/introduction-to-report-builder/basic-comparison-operators.md).

<figure><img src="https://1246578764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC21t2SaV2eKaLxvtR27D%2Fuploads%2FU41ik2Knw1WNRwbU5DhX%2Fimage.png?alt=media&amp;token=c7c338d4-c4c4-4504-99dd-3704733d061c" alt=""><figcaption><p>filter clauses under the <strong>AND Rule Set</strong> </p></figcaption></figure>

<figure><img src="https://1246578764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC21t2SaV2eKaLxvtR27D%2Fuploads%2FhHi1qqOSagw756wLk6H6%2Fimage.png?alt=media&amp;token=664e95de-b709-443f-9924-48096185bf3d" alt=""><figcaption><p>additional filter clauses under the <strong>OR Rule Set</strong></p></figcaption></figure>

Another example using only the AND logical operator for all the filters clauses:

<figure><img src="https://1246578764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC21t2SaV2eKaLxvtR27D%2Fuploads%2Fk3MT3qdP79a2T78jqVfi%2Fimage.png?alt=media&amp;token=5eb8b3f0-0d03-4ee2-acfe-627613dc7859" alt=""><figcaption><p>Sample Report using the AND logical operator</p></figcaption></figure>

In the sample screenshot above, the **AND** logical operator is being used for the three filter clauses. Meaning the report will output only enrolments within the start dates of 2022-01-01 and the expected end date of 2023-01-01, with an enrolment status of **Enrolled**, and with an Invoice Id that is still blank. All four conditions should be true as the logical operator being used is **AND**. The above sample report is a report that will output Unit Enrolments that have not been Invoiced.

Refer to the information below for more details and examples on using the logical operator AND and OR in Report Builder:

## **AND** <a href="#and" id="and"></a>

This will return all the data or information which are TRUE FOR ALL conditions separated by AND.

**Example**

> “Start Date” > 2019-01-01 **AND** “Course Enrolment Status Id” In ENROLLED

<figure><img src="https://1246578764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC21t2SaV2eKaLxvtR27D%2Fuploads%2F9OM4qTeXhtQzgzC0c3vK%2Fimage.png?alt=media&amp;token=119160eb-e599-4f9e-a9ab-4102559ceed3" alt=""><figcaption><p>filter clauses joined by AND</p></figcaption></figure>

**Output**

Conditions allow for clauses to be joined together to form more complex filter clauses. e.g. “Start Date” > 01/01/2019 **AND** “Course Enrolment Status Id” In ENROLLED.

This will produce a list of students who have a start date greater than 01/01/2019 **AND** have a course enrolments status of enrolled. To appear in this data set the record must satisfy **BOTH** conditions. Or if more conditions are added using the AND condition the record has to meet all of the required criteria to be returned in the produced data set.

The example used for this report is the Centrelink report. This is a pre-saved report within the report builder

**“Person Status’ IN Active AND**

**“Course Enrolment Status Id” IN Enrolled AND**

**“Overseas Student” NOT EQUAL Yes**.

**All three** of these criteria have to be met for a record to appear within the data set produced for this report.

## **OR** <a href="#or" id="or"></a>

This will return all the data or information which are TRUE FOR ANY of the conditions separated by OR.

**Example**

> “Start date” >01/01/2018 **OR** “Course Enrolment Status Id” in Enrolled

<figure><img src="https://1246578764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC21t2SaV2eKaLxvtR27D%2Fuploads%2FRwfhYFSQvcC1OgbaiSrD%2Fimage.png?alt=media&amp;token=48e33e2d-66f2-471a-90fa-83be6342ea35" alt=""><figcaption><p>filter clauses joined by OR</p></figcaption></figure>

**Output**

This will produce a list of students who have a start date of 01/01/2018 **OR** a Course Enrolment status of Enrolled **OR** both. The record only has to meet **ONE** criterion in the filter clauses to return a value in the produced data set.

{% hint style="info" %}
**NOTE**:

You can have multiple filters (with AND and OR conditions) that can be mixed and matched to reduce the data set to produce a specific data set from the whole database, *see* the [Advanced section: Nested Logical Operators Using AND | OR](broken://pages/moseCxAqtzAPugrobCmp) page
{% endhint %}
