> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dqlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Cases

> Real-world Conditional metric examples in Prizm — value range enforcement, completeness rules, and cross-column consistency checks.

<script type="application/ld+json">
  {`{
            "@context": "https://schema.org",
            "@type": "TechArticle",
            "headline": "Conditional Metric Use Cases",
            "description": "Real-world Conditional metric examples in Prizm - value range enforcement, completeness rules, and cross-column consistency checks.",
            "url": "https://docs.dqlabs.ai/architecture/metrics/conditional/usecases",
            "publisher": {
              "@type": "Organization",
              "name": "DQLabs Inc",
              "logo": "https://media.brand.dev/332adc35-5bc4-4d2b-bf78-256aa4a5e414.svg"
            }
            }`}
</script>

## Example use cases

**Value range enforcement:** A `QTY_SOLD` column must be between 10 and 20 for valid transactions. A Row check rule (`QTY_SOLD Between 10 and 20`) flags any record outside that range. If 27 of 237 records fall outside the range, the metric scores at 88.6%.

**Conditional completeness by order type:** Scope Select criteria to `order_type = 'express'` rows only, then add a Row check requiring `carrier_tracking_number` is not null. Only express orders are evaluated, so missing tracking numbers on standard orders don't affect the score.

**Cross-column consistency:** Use a **Col vs col** rule to verify `end_date >= start_date` on every contract record. Any row where the end date precedes the start date is marked invalid.

**Aggregate uniqueness enforcement:** Use an **Aggregate** rule with `No duplicates on` applied to `order_id` to ensure no duplicate orders exist in the asset. A single duplicate is enough to trigger a Critical alert when combined with a zero-tolerance threshold.

**Complex expression validation:** Use an **Expression** rule to enforce a multi-column business constraint that can't be expressed with a simple row check — e.g., `discount_amount <= (unit_price * quantity * 0.30)` to ensure no line item discount exceeds 30% of the line total.

<Tip>
  Use **Select criteria** to narrow which rows the rule applies to before configuring Condition rules. A rule applied to all rows often produces noise when the business condition is only meaningful for a subset of the data.
</Tip>
