# View: manual_adjustment_usd_and_ccur_other_adjustments

**View Name:** manual_adjustment_usd_and_ccur_other_adjustments
**Table Source:** `Derived from: Art_Relations_Prod_Art_Relations.Currencies, Art_Relations_Prod_Art_Relations.Currency_Exchange_Rates, Orchard_App_Reporting_V2.Art_Relations_Prod_Art_Relations, Prod.Vw_Abacus_Manual_Adjustment, Prod.Vw_Dim_Abacus_Ar_Booked_Vendor_Contract_Snapshot + 3 more`
**File Path:** `manual_adjustment_usd_and_ccur_other_adjustments.view.lkml`

## Overview

- **File Size:** 6717 bytes
- **Lines of Code:** 122
- **Dimensions:** 4
- **Measures:** 3
- **Dimension Groups:** 0
- **Filters:** 1

## Dimensions

| Name | Type |
|------|------|
| `labelid` | number |
| `primary_key` | number |
| `apply_to_period_id` | number |
| `payout_currency_code` | string |

## Measures

| Name | Type |
|------|------|
| `reserves_usd` | sum |
| `reserves_ccur` | sum |
| `other_adjustments_ccur` | sum |

## Filters

- `periodid_filter`

## Derived Table

```sql
sql: SELECT  ma.apply_to_period_id, ma.parent_id,  c.iso_4217_code as payout_currency_code,
            sum(ma.amount) as usd_adjustment,
            sum(ma.amount* cr.exchange_rate) as payout_currency_adjustment

            FROM ROYALTY_ACCOUNTING.PROD.VW_ABACUS_MANUAL_ADJUSTMENT ma

            left join ROYALTY_ACCOUNTING_REPORTING.PROD.VW_DIM_ABACUS_AR_BOOKED_VENDOR_CONTRACT_SNAPSHOT vcc on ma.parent_id=vcc.vendor_id and ma.apply_to_period_id=vcc.period_id

            left join orchard_app_reporting_v2.art_relations_prod_art_relations.currency_exchange_rates cr on cr.currency_to_id=vcc.currency_id

            and cr.period_id = ma.apply_to_period_id

            left join orchard_app_reporting_v2.art_relations_prod_art_relations.currencies c on c.id=cr.currency_to_id

            WHERE ma.parent_type = 'vendor' and cr.currency_from_id = 1 AND ma.category_id in (
                                                                                              2,
                                                                                              3,
                                                                                              4,
                                                                                              5,
                                                                                              6,
                                                                                              7,
                                                                                              8,
                                                                                              9,
                                                                                              10,
                                                                                              11,
                                                                                              12,
                                                                                              13,
                                                                                              14,
                                                                                              15,
                                                                                              16,
                                                                                              17,
                                                                                              18,
                                                                                              19,
                                                                                              20,
                                                                                              21,
                                                                                              23,
                                                                                              24,
                                                                                              25,
                                                                                              26,
                                                                                              27,
                                                                                              28,
                                                                                              29,
                                                                                              32,
                                                                                              33,
                                                                                              49,
                                                                                              50,
                                                                                              51,
                                                                                              52,
                                                                                              53,
                                                                                              54,
                                                                                              55,
                                                                                              56,
                                                                                              57,
                                                                                              58,
                                                                                              59,
                                                                                              60,
                                                                                              61,
                                                                                              64,
                                                                                              66,
                                                                                              67,
                                                                                              70,
                                                                                              72,
                                                                                              73)

            AND {% condition periodid_filter %
```

