# Timeliness and Conformity Rules

{% hint style="success" %}

#### Timeliness & Conformity Rules

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="Recent Order Activity" %}
{% hint style="info" %}

#### Recent Order Activity

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

**Business Rule Configuration:**

```
Rule Name: Order_Processing_Timeliness
Description: Ensures orders are shipped within 7 days of order date
Data Quality Dimension: Timeliness
Schedule: Daily
Target: Sales.SalesOrderHeader
```

**SQL Query:**

```sql
SELECT 
    COUNT(*) AS total_count,
    SUM(CASE 
        WHEN Status = 5  -- Shipped
        AND DATEDIFF(day, OrderDate, ShipDate) <= 7
        THEN 1 
        WHEN Status < 5  -- Not yet shipped
        AND DATEDIFF(day, OrderDate, GETDATE()) <= 7
        THEN 1 
        ELSE 0 
    END) AS scopeCount,
    SUM(CASE 
        WHEN Status = 5 
        AND DATEDIFF(day, OrderDate, ShipDate) > 7
        THEN 1 
        WHEN Status < 5 
        AND DATEDIFF(day, OrderDate, GETDATE()) > 7
        THEN 1 
        ELSE 0 
    END) AS nonCompliant
FROM Sales.SalesOrderHeader
WHERE OrderDate >= DATEADD(month, -1, GETDATE())  -- Last month's orders
```

***

x
{% endtab %}

{% tab title="Phone Numbers" %}
{% hint style="info" %}

#### Incomplete Product Information

**Scenario:** Enforce standard phone number format across all records.
{% endhint %}

**Business Rule Configuration:**

```
Rule Name: Phone_Number_Format_Conformity
Description: Validates phone numbers follow standard format pattern
Data Quality Dimension: Conformity
Schedule: Weekly
Target: Person.PersonPhone
```

**SQL Query:**

```sql
SELECT 
    COUNT(*) AS total_count,
    SUM(CASE 
        WHEN PhoneNumber LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'
        OR PhoneNumber LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'
        THEN 1 ELSE 0 
    END) AS scopeCount,
    SUM(CASE 
        WHEN PhoneNumber NOT LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'
        AND PhoneNumber NOT LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'
        THEN 1 ELSE 0 
    END) AS nonCompliant
FROM Person.PersonPhone
```

***

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/timeliness-and-conformity-rules.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.
