# View: vat_applied

**View Name:** vat_applied
**Table Source:** `Derived from: Prod_Royalty_Accounting_Royalty_Accounting.Abacus_Event, Prod_Royalty_Accounting_Royalty_Accounting.Account, Prod_Royalty_Accounting_Royalty_Accounting.Account_Contract, Prod_Royalty_Accounting_Royalty_Accounting.Accounting_Period, Prod_Royalty_Accounting_Royalty_Accounting.Contract + 3 more`
**File Path:** `views/vat_applied.view.lkml`

## Overview

- **File Size:** 3972 bytes
- **Lines of Code:** 138
- **Dimensions:** 19
- **Measures:** 0
- **Dimension Groups:** 0
- **Filters:** 0

## Dimensions

| Name | Type |
|------|------|
| `Statement_Period_ID` | string |
| `Statement_Period_Name` | string |
| `Accounting_Period_ID` | string |
| `Accounting_Period_Name` | string |
| `Abacus_Event_ID` | string |
| `Created_By` | string |
| `Account_ID` | string |
| `Account_Name` | string |
| `Contract_ID` | string |
| `Contract_Name` | string |
| `Company_Code` | string |
| `Profit_Center` | string |
| `Legal_Name` | string |
| `VAT_Number` | string |
| `Currency_Code` | string |
| `Commited_VAT_at` | string |
| `Balance_Before_Commit_VAT` | number |
| `Committed_Vat` | number |
| `Balance_After_Commit_VAT` | number |

## Derived Table

```sql
sql:
      SELECT
      ae.statement_period_id Statement_Period_ID,
      asp.statement_period_name Statement_Period_Name,
      ap.accounting_period_id Accounting_Period_ID,
      ap.accounting_period_name Accounting_Period_Name,
      ae.abacus_event_id Abacus_Event_ID,
      ae.created_by Created_By,
      a.account_id Account_ID,
      a.account_name Account_Name,
      lac.contract_id Contract_ID,
      c.contract_name Contract_Name,
      sap.company_code Company_Code,
      sap.profit_center Profit_Center,
      rse.legal_name Legal_Name,
      rse.vat_number VAT_Number,
      lac.currency_code Currency_Code,
      lac.created_at Commited_VAT_at,
      lac.previous_balance Balance_Before_Commit_VAT,
      lac.currency_amount Committed_Vat,
      lac.current_balance Balance_After_Commit_VAT
FROM ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.ABACUS_EVENT ae
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.LEDGER_ACCOUNT_CONTRACT lac
    ON lac.abacus_event_id=ae.abacus_event_id
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.CONTRACT c
      ON c.contract_id=lac.contract_id
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.REFERENCE_SIGNING_ENTITY rse
      ON rse.reference_signing_entity_id=c.reference_signing_entity_id
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.REFERENCE_SAP_PROFIT_CENTER sap
      ON sap.reference_sap_profit_center_id=rse.reference_sap_profit_center_id
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.ACCOUNT_CONTRACT ac
      ON ac.contract_id=c.contract_id
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.ACCOUNT a
      ON a.account_id=ac.account_id
    INNER JOIN ORCHARD_APP_REPORTING_V2.PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING.ACCOUNTING_PERIOD ap
      ON ap.accounting_period_id=ae.target_id
    join orchard_app_reporting_v2.prod_royalty_accounting_royalty_accounting.statement_period as asp on ae.STATEMENT_PERIOD_ID = asp.statement_period_id
WHERE ae.event_name='commit_vat'
ORDER BY ae.abacus_event_id ASC;;
```

