# View: dt_potential_double_booked_transactions_nr

**View Name:** dt_potential_double_booked_transactions_nr
**Table Source:** `Derived from: Orchard_App_Reporting_V2, Orchard_App_Reporting_V2.Prod_Royalty_Accounting_Royalty_Accounting, Prod.Accounting_Run_Results_Nr_Staging, Prod_Royalty_Accounting_Royalty_Accounting.Accounting_Period, Prod_Royalty_Accounting_Royalty_Accounting.Accounting_Run + 2 more`
**File Path:** `views/dt_potential_double_booked_transactions_nr.view.lkml`

## Overview

- **File Size:** 10160 bytes
- **Lines of Code:** 358
- **Dimensions:** 45
- **Measures:** 0
- **Dimension Groups:** 0
- **Filters:** 0

## Dimensions

| Name | Type |
|------|------|
| `account_id` | number |
| `contract_id` | number |
| `contract_txn_id` | number |
| `txn_id` | number |
| `accounting_run_id` | number |
| `accounting_run_name` | string |
| `royalty_rate` | string |
| `unit_price_sale_currency` | string |
| `gross_revenue_sale_currency` | string |
| `withholding_tax_sale_currency` | string |
| `gross_revenue_after_withholding_tax_sale_currency` | string |
| `net_share_sale_currency` | string |
| `unit_price_payee_currency` | string |
| `gross_revenue_payee_currency` | string |
| `withholding_tax_payee_currency` | string |
| `gross_revenue_after_withholding_tax_payee_currency` | string |
| `net_share_payee_currency` | string |
| `stmt_db_sales_nr_txn_id` | number |
| `unique_detail_id` | number |
| `sales_file_id` | number |
| `batch_id` | string |
| `statement_id` | number |
| `start_date` | string |
| `end_date` | string |
| `store_id` | string |
| `subdistributor` | string |
| `sale_currency_code` | string |
| `sale_currency_code_id` | number |
| `activity_rate` | string |
| `country_id` | number |
| `configuration` | string |
| `transaction_type` | string |
| `transaction_type_id` | number |
| `transaction_subtype_id` | number |
| `contributor_only` | string |
| `contributor_id` | string |
| `contributor_name` | string |
| `contribution_id` | string |
| `isrc` | string |
| `sound_recording_id` | string |
| `sound_recording_name` | number |
| `quantity` | number |
| `unit_price_usd` | string |
| `total_usd` | string |
| `withholding_tax_usd` | string |

## Derived Table

```sql
sql:
      WITH duplicate_txn AS (
          SELECT arrns.TXN_ID, COUNT(arrns.TXN_ID)
          FROM ROYALTY_ACCOUNTING.PROD.ACCOUNTING_RUN_RESULTS_NR_STAGING arrns
          JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.ACCOUNTING_RUN ar
              ON ar.ACCOUNTING_RUN_ID = arrns.ACCOUNTING_RUN_ID
          JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.ACCOUNTING_PERIOD ap
              ON ap.ACCOUNTING_PERIOD_ID = ar.ACCOUNTING_PERIOD_ID
          WHERE ap.STATEMENT_PERIOD_ID = {% parameter statement_period_id %
```

