# View: dt_abacus_oa_contract_monitoring

**View Name:** dt_abacus_oa_contract_monitoring
**Table Source:** `Derived from: Prod.Vw_Dim_Abacus_Ar_Vendor, Prod.Vw_Dim_Abacus_Ar_Vendor_Contract, Prod.Vw_Dim_Abacus_Contract, Royalty_Accounting, Royalty_Accounting.Prod + 2 more`
**File Path:** `views/dt_abacus_oa_contract_monitoring.view.lkml`

## Overview

- **File Size:** 1304 bytes
- **Lines of Code:** 49
- **Dimensions:** 5
- **Measures:** 0
- **Dimension Groups:** 0
- **Filters:** 0

## Dimensions

| Name | Type |
|------|------|
| `vendor_id` | number |
| `date_created` | string |
| `last_update` | string |
| `owner` | string |
| `status` | string |

## SQL Comments

- all abacus vendors (migrated_to_abacus = 1)
- abacus vendors missing a contract

## Derived Table

```sql
sql:
        select
            v.vendor_id as vendor_id,
            v.date_created as date_created,
            v.last_update as last_update,
            v.owner as owner,
            v.status as status
        from royalty_accounting_reporting.prod.vw_dim_abacus_ar_vendor v -- all abacus vendors (migrated_to_abacus = 1)
        left join royalty_accounting_reporting.prod.vw_dim_abacus_ar_vendor_contract vc on v.vendor_id = vc.vendor_id
        where migrated_to_abacus = 1 and vc.vendor_id is NULL -- abacus vendors missing a contract
        and exists (
          select
            account_id
          from royalty_accounting.prod.vw_dim_abacus_contract dc where dc.account_id = v.vendor_id
          and dc.SAP_CREATED_AT < current_timestamp - INTERVAL '1 hour'
        )
        order by vendor_id desc
        ;;
```

