# Rule Groups

{% hint style="success" %}

#### Rule Groups

In this series of detailed workshops we're going to:

* Understand the business value and ROI of implementing business rules
* Master the 7 Data Quality Dimensions in PDC
* Create and configure business rules with detailed step-by-step guidance
* Implement rule actions (Status, Tags, Webhooks) and understand their purpose
* Organize rules using rule groups for operational efficiency
* Monitor and interpret rule execution results for continuous improvement

{% endhint %}

x

***

{% hint style="info" %}

#### Accessing your Catalog

To get started using the Data Catalog, log in using the address and credentials provided by your Data Catalog service user or administrator.
{% endhint %}

To access your catalog, please follow these steps:

1. Open **Google Chrome** web browser.
2. Navigate to:

{% embed url="<https://pdc.pentaho.lab>" %}

3. Enter following email and password, then click **Sign In**.

Username: <david.park@adventureworks.com> (mapped to Business Steward role)

Password: Welcome123!

***

x

x

{% tabs %}
{% tab title="Daily Sales Quality Checks" %}
{% hint style="info" %}

#### Daily Sales Quality Checks

**Scenario:** Monitor that orders are being processed within expected timeframes.
{% endhint %}

**Rule Group: Daily\_Sales\_Quality\_Checks**

* Customer\_Email\_Completeness
* Order\_Date\_Validity
* Order\_SubTotal\_Calculation\_Accuracy
* Order\_Processing\_Timeliness

**Configuration:**

```
Group Name: Daily_Sales_Quality_Checks
Description: Critical daily validations for sales data integrity
Schedule: Daily at 6:00 AM
Rules: [4 rules listed above]
```

***

x
{% endtab %}

{% tab title="Customer Overall DQ Score" %}
{% hint style="info" %}

#### Cutomer Overall DQ Score

**Scenario:** Comprehensive Customer Data Quality Score
{% endhint %}

**Business Rule Configuration:**

```
Rule Name: Customer_Overall_DQ_Score
Description: Composite data quality assessment across customer data
Data Quality Dimension: Accuracy
Schedule: Daily
Target: Person.Person, Sales.Customer
```

**SQL Query:**

```sql
WITH CustomerQuality AS (
    SELECT 
        c.CustomerID,
        CASE WHEN e.EmailAddress IS NOT NULL THEN 1 ELSE 0 END AS HasEmail,
        CASE WHEN pp.PhoneNumber IS NOT NULL THEN 1 ELSE 0 END AS HasPhone,
        CASE WHEN ba.AddressID IS NOT NULL THEN 1 ELSE 0 END AS HasAddress,
        CASE WHEN so.SalesOrderID IS NOT NULL THEN 1 ELSE 0 END AS HasOrders
    FROM Sales.Customer c
    LEFT JOIN Person.Person p ON c.PersonID = p.BusinessEntityID
    LEFT JOIN Person.EmailAddress e ON p.BusinessEntityID = e.BusinessEntityID
    LEFT JOIN Person.PersonPhone pp ON p.BusinessEntityID = pp.BusinessEntityID
    LEFT JOIN Person.BusinessEntityAddress ba ON p.BusinessEntityID = ba.BusinessEntityID
    LEFT JOIN Sales.SalesOrderHeader so ON c.CustomerID = so.CustomerID
),
QualityScore AS (
    SELECT 
        CustomerID,
        (HasEmail + HasPhone + HasAddress + HasOrders) AS Score
    FROM CustomerQuality
)
SELECT 
    COUNT(*) AS total_count,
    SUM(CASE WHEN Score >= 3 THEN 1 ELSE 0 END) AS scopeCount,
    SUM(CASE WHEN Score < 3 THEN 1 ELSE 0 END) AS nonCompliant
FROM QualityScore
```

**Rule Actions with Multiple Thresholds:**

* **PASS**: ≥ 95% customers with score ≥3 → Tags: "gold\_standard"
* **WARNING**: 85-95% → Tags: "needs\_improvement", Webhook to Data Steward
* **FAIL**: < 85% → Tags: "critical\_remediation", Webhook to VP of Data

***

x
{% endtab %}
{% endtabs %}

x

x

{% tabs %}
{% tab title="First Tab" %}
x
{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}

x


---

# Agent Instructions: 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:

```
GET https://academy.pentaho.com/pentaho-data-catalog-en/data-catalog/business-rules/rule-groups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
