# View: release_perc_of_revenue

**View Name:** release_perc_of_revenue
**Table Source:** `Derived from: Bi.Accounting_Aggregates`
**File Path:** `release_perc_of_revenue.view.lkml`

## Overview

- **File Size:** 4810 bytes
- **Lines of Code:** 147
- **Dimensions:** 6
- **Measures:** 0
- **Dimension Groups:** 0
- **Filters:** 2

## Dimensions

| Name | Type |
|------|------|
| `upc` | string |
| `labelid` | string |
| `release_total_revenue` | string |
| `running_total` | string |
| `label_total_revenue` | string |
| `release_perc_of_revenue` | number |

## Filters

- `activity_month_filter`
- `labelid_filter`

## Derived Table

```sql
sql: select
        z.upc,
        z.labelid,
        z.release_total_revenue,
        z.running_total,
        z.label_total_revenue,
        z.running_total/nullif(label_total_revenue,0) as release_perc_of_revenue

        from

          (
           select
           y.labelid,
           y.upc,
           y.release_total_revenue,
           c.label_total_revenue,
           (
              SELECT
              SUM(x.total_gross_revenue_usd)
              FROM
                   (
                  select
                  row_number() over (partition by c.labelid order by c.total_gross_revenue_usd desc) as id,
                  c.labelid,
                  c.upc,
                  c.total_gross_revenue_usd
                  from
                      (SELECT
                      accounting_aggregates.labelid as labelid,
                      accounting_aggregates.releaseid AS upc,
                      COALESCE(SUM(accounting_aggregates.gross_revenue_usd), 0) AS total_gross_revenue_usd
                      FROM prod.bi.accounting_aggregates AS accounting_aggregates
                      WHERE accounting_aggregates.aggregate='Release Level'
                      and {% condition activity_month_filter %
```

