# View: currency_exchange_rate_lookup

**View Name:** currency_exchange_rate_lookup
**Table Source:** `Derived from: Prod.Currency_Exchange_Rates, Prod.Dim_Currency`
**File Path:** `currency_exchange_rate_lookup.view.lkml`

## Overview

- **File Size:** 1414 bytes
- **Lines of Code:** 50
- **Dimensions:** 4
- **Measures:** 0
- **Dimension Groups:** 0
- **Filters:** 0

## Comments & Notes

- Required user inputs

## Dimensions

| Name | Type |
|------|------|
| `from_currency_code` | string |
| `to_currency_code` | string |
| `period_id` | number |
| `exchange_rate_from_payout_currency_to_usd` | number |

## Derived Table

```sql
sql:
      SELECT
        cer.exchange_rate AS exchange_rate_from_payout_currency_to_usd,
        TO_DECIMAL(1/cer.exchange_rate::FLOAT, 29, 13) AS exchange_rate_from_usd_to_payout_currency,
        dc.currency_code AS from_currency_code,
        dc2.currency_code AS to_currency_code,
        cer.period_id
      FROM facts.prod.currency_exchange_rates cer
      INNER JOIN facts.prod.dim_currency dc
        ON dc.currencyId = cer.currency_from_id
      INNER JOIN facts.prod.dim_currency dc2
        ON dc2.currencyId = cer.currency_to_id
      WHERE cer.currency_to_id = 170
        AND dc.currency_code = {% parameter payout_currency_code %
```

