# View: royalty_accounting_prod_vw_abacus_fact_sales_publishing

**View Name:** royalty_accounting_prod_vw_abacus_fact_sales_publishing
**Table Source:** `Derived from: Prod.Vw_Abacus_Fact_Sales_Publishing, Royalty_Accounting, Royalty_Accounting.Prod`
**File Path:** `views/royalty_accounting_prod_vw_abacus_fact_sales_publishing.view.lkml`

## Overview

- **File Size:** 11572 bytes
- **Lines of Code:** 410
- **Dimensions:** 40
- **Measures:** 8
- **Dimension Groups:** 0
- **Filters:** 0

## Comments & Notes

- Origin Source Country: this is the most detailed value for source_country.
- Consolidated Source Country: as there's no country normalization, this is also the most detailed value for source_country.
- Origin Source Name: this is the most detailed value for source_name.

## Dimensions

| Name | Type |
|------|------|
| `statement_detail_id` | number |
| `period_id` | number |
| `song_no` | number |
| `song` | string |
| `writer` | string |
| `source1_name` | string |
| `source1_country` | string |
| `source2_name` | string |
| `source2_country` | string |
| `source3_name` | string |
| `source3_country` | string |
| `source4_name` | string |
| `source4_country` | string |
| `origin_source_country` | string |
| `consolidated_source_country` | string |
| `origin_source_name` | string |
| `consolidated_source_name` | string |
| `income_type` | string |
| `sh_id` | number |
| `rptg_pd` | string |
| `sales_pd` | string |
| `product_number` | string |
| `artist_product_number` | string |
| `song_share_percent` | number |
| `control_percent` | number |
| `royalty_percent` | number |
| `df` | string |
| `source_product` | string |
| `iswc` | string |
| `external_song_id` | number |
| `artist` | string |
| `source_song` | string |
| `isrc` | string |
| `transaction_id` | number |
| `account_id` | number |
| `has_multiple_owners` | yesno |
| `vendor_controlled_share` | number |
| `fee_percent` | number |
| `preferred_currency` | string |
| `currency_conversion_rate` | number |

## Measures

| Name | Type |
|------|------|
| `units` | sum |
| `amount` | sum |
| `royalty_amount` | sum |
| `adjusted_share` | sum |
| `adjusted_gross` | sum |
| `orchard_fee` | sum |
| `net_revenue` | sum |
| `net_revenue_preferred_currency` | sum |

## Derived Table

```sql
sql:
        SELECT
          *,
          COALESCE(source4_name, source3_name, source2_name, source_name) AS origin_source_name,
          COALESCE(source4_country, source3_country, source2_country, source_country) AS origin_source_country
        FROM ROYALTY_ACCOUNTING.PROD.VW_ABACUS_FACT_SALES_PUBLISHING;;
```

