# View: dt_proper_changed_releases

**View Name:** dt_proper_changed_releases
**Table Source:** `Derived from: Art_Relations_Prod_Art_Relations.Delivery_History, Art_Relations_Prod_Art_Relations.Product_Physical, Art_Relations_Prod_Art_Relations.Product_Physical_Change_History, Art_Relations_Prod_Art_Relations.Releases, Orchard_App_Reporting_V2 + 1 more`
**File Path:** `dt_proper_changed_releases.view.lkml`

## Overview

- **File Size:** 9855 bytes
- **Lines of Code:** 341
- **Dimensions:** 40
- **Measures:** 0
- **Dimension Groups:** 0
- **Filters:** 2

## Dimensions

| Name | Type |
|------|------|
| `CatalogNumber` | string |
| `format` | string |
| `artist` | string |
| `title` | string |
| `field_name` | string |
| `Barcode` | string |
| `DateReleased` | string |
| `Price_1` | string |
| `Decimal_field_1` | string |
| `Decimal_field_2` | string |
| `Decimal_field_3` | string |
| `Decimal_field_4` | string |
| `Decimal_field_5` | string |
| `Label_Code` | string |
| `Weight` | string |
| `Char_field_1` | string |
| `Char_field_2` | string |
| `Char_field_3` | string |
| `Supplier` | string |
| `Char_field_4` | string |
| `Deletion_Type` | string |
| `Decimal_field_6` | string |
| `primary_genre` | string |
| `secondary_genre` | string |
| `embargodate` | string |
| `Packshot_URL` | string |
| `LiveDate` | string |
| `Char_field_5` | string |
| `sublabel` | string |
| `salesnotes` | string |
| `formid` | string |
| `units` | string |
| `packageid` | string |
| `netweight` | string |
| `netlength` | string |
| `netheight` | string |
| `netwidth` | string |
| `variant` | string |
| `action_code` | string |
| `article_status` | string |

## Filters

- `date_filter`
- `store_filter`

## SQL Comments

- JOIN orchard_app_reporting_v2.art_relations_prod_art_relations.product_physical p ON p.release_id = ppch.product_id

## Derived Table

```sql
sql: WITH dt_proper_changed_releases_new AS (WITH changes AS (SELECT
          ppch.product_id,
          ppch.delivered,
          ppch.field_name,
          array_agg(ppch.new_sale_start_date) WITHIN GROUP (order by date_changed DESC) AS new_sale_start_date,
          array_agg(ppch.new_price) WITHIN GROUP (order by date_changed DESC) AS new_price,
          array_agg(ppch.new_deletion_status) WITHIN GROUP (order by date_changed DESC) AS new_deletion_status,
          array_agg(ppch.artworkpath) WITHIN GROUP (order by date_changed DESC) AS artworkpath,
          array_agg(ppch.new_embargo_date) WITHIN GROUP (order by date_changed DESC) AS new_embargo_date
      FROM orchard_app_reporting_v2.art_relations_prod_art_relations.product_physical_change_history ppch
      --JOIN orchard_app_reporting_v2.art_relations_prod_art_relations.product_physical p ON p.release_id = ppch.product_id
      left join ORCHARD_APP_REPORTING_V2.ART_RELATIONS_PROD_ART_RELATIONS.RELEASES r on r.release_id = ppch.product_id
      left join ORCHARD_APP_REPORTING_V2.ART_RELATIONS_PROD_ART_RELATIONS.DELIVERY_HISTORY dh on dh.upc = r.upc
      WHERE dh.customer_master_master_id = 696
      AND {% condition date_filter %
```

