# View: Delivery_App_Claims_Status

**View Name:** Delivery_App_Claims_Status
**Table Source:** `Derived from: Art_Relations_Prod_Art_Relations.Customer_Master_Master, Prod.Nr_Contribution_Contributed_To_Nr_Sound_Recording, Prod.Nr_Contribution_Type, Prod.Performance_Nr_Contribution, Prod.Performance_Nr_Contributor + 3 more`
**File Path:** `views/Delivery_App_Claims_Status.view.lkml`

## Overview

- **File Size:** 4083 bytes
- **Lines of Code:** 140
- **Dimensions:** 15
- **Measures:** 0
- **Dimension Groups:** 1
- **Filters:** 0

## Dimensions

| Name | Type |
|------|------|
| `Customer_Name` | string |
| `Contribution_UUID` | string |
| `Contributor_Name` | string |
| `NR_ID` | string |
| `NR_Contributor_ID` | string |
| `Primary_Artist_Displayed_As` | string |
| `Song_Name` | string |
| `Recording_Version` | string |
| `ISRC` | string |
| `Type` | string |
| `Valid` | string |
| `Status` | string |
| `Message` | string |
| `Claim_ID` | string |
| `Job_ID` | string |

## Dimension Groups

| Name | Type |
|------|------|
| `Last_Updated` | time |

## SQL Comments

- remove and cont.is_deleted not like true and include as default filter on looker
- the below lines have been added
- where -- c.CONTRIBUTION_UUID = '0537d30c-f18d-4191-8f27-8d60ddaa713e'
- cmm.customer_name like '%SENA%'

## Derived Table

```sql
sql:
select
cmm.customer_name Customer_Name,
c.CONTRIBUTION_UUID,
nrbutor.name Contributor_Name,
sr.id NR_ID,
cont.nr_contributor_id NR_Contributor_ID,
sr.main_artist Primary_Artist_Displayed_As,
sr.recording_title Song_Name,
    sr.version Recording_Version,
    sr.isrc ISRC,
    cont.contribution_type Type,
    nrbution.valid,
c.STATUS,
c.MESSAGE,
c.ID Claim_ID,
c.JOB_ID,
c.LAST_UPDATED
from ORCHARD_APP_REPORTING_V2.PROD_PERFORMANCE_NR_DELIVERY_NEIGHBOURING_RIGHTS_DELIVERY.claims c
left join ORCHARD_APP_REPORTING_V2.PROD_PERFORMANCE_NR_DELIVERY_NEIGHBOURING_RIGHTS_DELIVERY.claiming_job cj on c.job_id = cj.id
left join ORCHARD_APP_REPORTING_V2.PROD_PERFORMANCE_NR_DELIVERY_NEIGHBOURING_RIGHTS_DELIVERY.claiming_order co on cj.order_id = co.id
LEFT JOIN ORCHARD_APP_REPORTING_V2.ART_RELATIONS_PROD_ART_RELATIONS.CUSTOMER_MASTER_MASTER cmm ON cmm.CUSTOMER_MASTER_MASTER_ID=co.customer_master_master_id
left join FACTS.prod.PERFORMANCE_NR_CONTRIBUTION nrbution on c.contribution_uuid = nrbution.id
inner join FACTS.prod.nr_contribution_type cont on nrbution.id = cont.nr_contribution_id  and cont.is_deleted not like true
inner join FACTS.prod.PERFORMANCE_NR_CONTRIBUTOR nrbutor on cont.nr_contributor_id = nrbutor.id
inner join FACTS.prod.nr_contribution_contributed_to_nr_sound_recording nsr on nrbution.id = nsr.nr_contribution_id
-- remove and cont.is_deleted not like true and include as default filter on looker
inner join FACTS.prod.PERFORMANCE_NR_SOUND_RECORDING sr on nsr.nr_sound_recording_id = sr.id  and sr.is_deleted not like true
left join orchard_app_reporting_v2.art_relations_prod_art_relations.country mc ON sr.country_of_master = mc.country_code
left join orchard_app_reporting_v2.art_relations_prod_art_relations.country cc ON nrbution.country_of_performance = cc.country_code
left join orchard_app_reporting_v2.art_relations_prod_art_relations.country cl ON sr.country_of_label = cl.country_code
-- the below lines have been added
left join table(flatten (input => sr.countries_of_recording, outer => TRUE)) cr
left join orchard_app_reporting_v2.art_relations_prod_art_relations.country cy on cy.country_code=cr.value
--where -- c.CONTRIBUTION_UUID = '0537d30c-f18d-4191-8f27-8d60ddaa713e'
--cmm.customer_name like '%SENA%'
group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
order by cmm.customer_name, c.LAST_UPDATED desc;;
```

