# Data Lineage & Dependencies

Generated on: 2026-01-09 19:42:39

This document shows the relationships and dependencies between models, views, and data sources.

## Overview

- **Total Models:** 16
- **Total Views:** 29
- **Derived Views:** 5
- **Direct Table Views:** 24

## Model Dependencies

### Models and Their Views

#### RM_Dashboard
- **Includes:** 2 views
- **Views:**
  - `rm_dashboard/*`
  - `orchard_app_reporting/*`

#### RM_Dashboard_Catalog_Split
- **Includes:** 2 views
- **Views:**
  - `rm_dashboard/*`
  - `orchard_app_reporting/*`

#### RM_Dashboard_Country_Store_Split
- **Includes:** 2 views
- **Views:**
  - `rm_dashboard/*`
  - `orchard_app_reporting/*`

#### RM_Dashboard_Label_Store_Split
- **Includes:** 2 views
- **Views:**
  - `rm_dashboard/*`
  - `orchard_app_reporting/*`

#### RM_Dashboard_Revenue_over_Time
- **Includes:** 2 views
- **Views:**
  - `rm_dashboard/*`
  - `orchard_app_reporting/*`

#### RM_Dashboard_Services
- **Includes:** 2 views
- **Views:**
  - `rm_dashboard/*`
  - `orchard_app_reporting/*`

#### Spotify_DM_Agg
- **Includes:** 1 views
- **Views:**
  - `spotify_dm/int_dbt_prod_spotify_dm_agg_streams`

#### Spotify_DM_Chartmetric_Stats
- **Includes:** 1 views
- **Views:**
  - `spotify_dm/int_dbt_prod_chartmetric_stats`

#### Spotify_DM_Lifted
- **Includes:** 1 views
- **Views:**
  - `spotify_dm/int_dbt_prod_spotify_dm_raw_lift_streams`

#### Spotify_DM_Lifted_Agg
- **Includes:** 1 views
- **Views:**
  - `spotify_dm/int_dbt_prod_spotify_dm_postdm_lift_streams`

#### deal_risk_analysis
- **Includes:** 1 views
- **Views:**
  - `deal_risk_analysis/*`

#### sme_latam_weekly_unified_chart
- **Includes:** 1 views
- **Views:**
  - `sme_latam_weekly_chart/*`

#### territory_kpis
- **Includes:** 1 views
- **Views:**
  - `territory_kpis/*`

#### youtube
- **Includes:** 1 views
- **Views:**
  - `youtube/*`

#### youtube_video_reports
- **Includes:** 3 views
- **Views:**
  - `youtube_bulk_reporting_api/*`
  - `facts_prod/dim_youtube_channel_names`
  - `dt_migration/youtube_video_titles_mapping`

## View Dependencies

### Views by Data Source

#### Direct Database Tables
Views that directly reference database tables:

**art_relations_prod_art_relations.currencies**
- Used by 1 views: `orch_app_ar_currencies`


**dbt_prod.deal_analysis_metrics_overview**
- Used by 1 views: `deal_analysis_metrics_overview`


**dbt_prod_strategy.SPOTIFY_DM_RAW_LIFT_STREAMS**
- Used by 1 views: `int_dbt_prod_spotify_dm_raw_lift_streams`


**dbt_prod_strategy.SPOTIFY_DM_RAW_STREAMS**
- Used by 1 views: `int_dbt_prod_spotify_dm_raw_streams`


**dbt_prod_strategy.label_lookback**
- Used by 1 views: `int_dbt_prod_label_lookback`


**dbt_prod_strategy.rm_db_accounting_base_periods**
- Used by 1 views: `int_dbt_prod_rm_db_accounting_base_periods`


**dbt_prod_strategy.rm_db_accounting_label_catalog_split**
- Used by 1 views: `int_dbt_prod_rm_db_accounting_label_catalog_split`


**dbt_prod_strategy.rm_db_accounting_label_country_split**
- Used by 1 views: `int_dbt_prod_rm_db_accounting_label_country_split`


**dbt_prod_strategy.rm_db_accounting_label_store_split**
- Used by 1 views: `int_dbt_prod_rm_db_accounting_label_store_split`


**dbt_prod_strategy.rm_db_accounting_revenue_over_time**
- Used by 1 views: `int_dbt_prod_rm_db_accounting_revenue_over_time`


**dbt_prod_strategy.rm_db_accounting_services_revenue_coalesce**
- Used by 1 views: `int_dbt_prod_rm_db_accounting_services_revenue_coalesce`


**dbt_prod_strategy.rm_db_label_rm_mapping**
- Used by 1 views: `int_dbt_prod_rm_db_label_rm_mapping`


**dbt_prod_strategy.salesforce_new_deal_revenue_by_activity_date**
- Used by 1 views: `int_dbt_prod_new_deal_revenue_activity`


**dbt_prod_strategy.salesforce_new_deal_revenue_summary**
- Used by 1 views: `int_dbt_prod_new_deal_revenue_summary`


**dbt_prod_strategy.sme_latam_charting_filtered**
- Used by 1 views: `int_dbt_prod_sme_latam_charting_filtered`


**dbt_prod_strategy.spotify_dm_agg_streams**
- Used by 1 views: `int_dbt_prod_spotify_dm_agg_streams`


**dbt_prod_strategy.spotify_dm_postdm_lift_streams**
- Used by 1 views: `int_dbt_prod_spotify_dm_postdm_lift_streams`


**dbt_prod_strategy.stg_ifpi_transaction_country_report_filterable**
- Used by 1 views: `int_dbt_prod_transaction_country_report_filterable`


**dbt_prod_strategy.struggling_deal_analysis**
- Used by 1 views: `int_dbt_prod_struggling_deal_analysis`


**dbt_prod_strategy.video_combined_intermediate**
- Used by 1 views: `int_dbt_prod_video_combined_intermediate`


**dbt_prod_strategy.youtube_avod_fill_rate**
- Used by 1 views: `youtube_avod_fill_rate`


**dev_sgraig.spotify_dm_cm_stats_temp_20250612**
- Used by 1 views: `int_dbt_prod_chartmetric_stats`


**prod.dim_youtube_channel_names**
- Used by 1 views: `dim_youtube_channel_names`


**yt_reports_api.demographics_intermediate**
- Used by 1 views: `int_dbt_prod_video_demographics_intermediate`


#### Derived Tables
Views with custom SQL (complex transformations):

Total: 5 views

| View | Lines of Code | Source Tables |
|------|---------------|---------------|
| `int_dbt_prod_summary_territory_kpis` | 413 |  Cy25_Targets, Dbt_Prod_Strategy.Ifpi_Summary_T... |
| `int_dbt_prod_monthly_territory_kpis` | 105 | Custom SQL |
| `int_dbt_prod_label_country_report` | 88 |  Dbt_Prod_Strategy.Ifpi_Label_Country_Report, I... |
| `int_dbt_prod_transaction_country_report` | 85 |  Dbt_Prod_Strategy.Ifpi_Transaction_Country_Rep... |
| `youtube_video_titles_mapping` | 36 | Custom SQL |


## Explore Relationships

### Explores and Their Dependencies

#### Model: RM_Dashboard

**int_dbt_prod_rm_db_accounting_base_periods** (RM Dashboard)
- Base View: `int_dbt_prod_rm_db_accounting_base_periods`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.rm_db_accounting_base_periods

#### Model: RM_Dashboard_Catalog_Split

**int_dbt_prod_rm_db_accounting_label_catalog_split** (RM Dashboard Label Catalog Split)
- Base View: `int_dbt_prod_rm_db_accounting_label_catalog_split`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.rm_db_accounting_label_catalog_split

#### Model: RM_Dashboard_Country_Store_Split

**int_dbt_prod_rm_db_accounting_label_country_split** (RM Dashboard Label Store Split)
- Base View: `int_dbt_prod_rm_db_accounting_label_country_split`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.rm_db_accounting_label_country_split

#### Model: RM_Dashboard_Label_Store_Split

**int_dbt_prod_rm_db_accounting_label_store_split** (RM Dashboard Label Store Split)
- Base View: `int_dbt_prod_rm_db_accounting_label_store_split`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.rm_db_accounting_label_store_split

#### Model: RM_Dashboard_Revenue_over_Time

**int_dbt_prod_rm_db_accounting_revenue_over_time** (RM Dashboard Revenue over Time)
- Base View: `int_dbt_prod_rm_db_accounting_revenue_over_time`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.rm_db_accounting_revenue_over_time

#### Model: RM_Dashboard_Services

**int_dbt_prod_rm_db_accounting_services_revenue_coalesce** (RM Dashboard Services Revenue)
- Base View: `int_dbt_prod_rm_db_accounting_services_revenue_coalesce`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.rm_db_accounting_services_revenue_coalesce

#### Model: Spotify_DM_Agg

**int_dbt_prod_spotify_dm_agg_streams** (Spotify DM (Aggregated))
- Base View: `int_dbt_prod_spotify_dm_agg_streams`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.spotify_dm_agg_streams

#### Model: Spotify_DM_Chartmetric_Stats

**int_dbt_prod_chartmetric_stats** (Spotify DM Chartmetric)
- Base View: `int_dbt_prod_chartmetric_stats`
- View Type: Direct Table
- Data Source: intelligence.dev_sgraig.spotify_dm_cm_stats_temp_20250612

#### Model: Spotify_DM_Lifted

**int_dbt_prod_spotify_dm_raw_lift_streams** (Spotify DM Lifted)
- Base View: `int_dbt_prod_spotify_dm_raw_lift_streams`
- View Type: Direct Table
- Data Source: INTELLIGENCE.dbt_prod_strategy.SPOTIFY_DM_RAW_LIFT_STREAMS

#### Model: Spotify_DM_Lifted_Agg

**int_dbt_prod_spotify_dm_postdm_lift_streams** (Spotify DM Lifted Agg)
- Base View: `int_dbt_prod_spotify_dm_postdm_lift_streams`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.spotify_dm_postdm_lift_streams

#### Model: deal_risk_analysis

**int_dbt_prod_struggling_deal_analysis** (Deal Risk Analysis)
- Base View: `int_dbt_prod_struggling_deal_analysis`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.struggling_deal_analysis

**int_dbt_prod_new_deal_revenue_summary** (New Deal Summary)
- Base View: `int_dbt_prod_new_deal_revenue_summary`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.salesforce_new_deal_revenue_summary

**int_dbt_prod_new_deal_revenue_activity** (New Deal Activity)
- Base View: `int_dbt_prod_new_deal_revenue_activity`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.salesforce_new_deal_revenue_by_activity_date

**int_dbt_prod_label_lookback** (Label Lookback)
- Base View: `int_dbt_prod_label_lookback`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.label_lookback

#### Model: sme_latam_weekly_unified_chart

**int_dbt_prod_sme_latam_charting_filtered** (SME LATAM Weekly Unified Chart)
- Base View: `int_dbt_prod_sme_latam_charting_filtered`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.sme_latam_charting_filtered

#### Model: territory_kpis

**int_dbt_prod_summary_territory_kpis** (Summary Territory KPIs)
- Base View: `int_dbt_prod_summary_territory_kpis`
- View Type: Derived Table
- Data Source: Derived from: Cy25_Targets, Dbt_Prod_Strategy.Ifpi_Summary_Territory_Kpis, Dev_Z...

**int_dbt_prod_monthly_territory_kpis** (Monthly Territory KPIs)
- Base View: `int_dbt_prod_monthly_territory_kpis`
- View Type: Derived Table
- Data Source: Derived Table (Custom SQL)

**int_dbt_prod_transaction_country_report** (Transaction Country Report)
- Base View: `int_dbt_prod_transaction_country_report`
- View Type: Derived Table
- Data Source: Derived from: Dbt_Prod_Strategy.Ifpi_Transaction_Country_Report, Intelligence.Db...

**int_dbt_prod_label_country_report** (Label Country Report)
- Base View: `int_dbt_prod_label_country_report`
- View Type: Derived Table
- Data Source: Derived from: Dbt_Prod_Strategy.Ifpi_Label_Country_Report, Intelligence.Dbt_Prod...

**int_dbt_prod_transaction_country_report_filterable** (Transaction Country Report (Filterable))
- Base View: `int_dbt_prod_transaction_country_report_filterable`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.stg_ifpi_transaction_country_report_filterable

#### Model: youtube

**youtube_avod_fill_rate** (youtube_avod_fill_rate)
- Base View: `youtube_avod_fill_rate`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.youtube_avod_fill_rate

#### Model: youtube_video_reports

**int_dbt_prod_video_combined_intermediate** (YouTube Channel)
- Base View: `int_dbt_prod_video_combined_intermediate`
- View Type: Direct Table
- Data Source: intelligence.dbt_prod_strategy.video_combined_intermediate

**int_dbt_prod_video_demographics_intermediate** (int_dbt_prod_video_demographics_intermediate)
- Base View: `int_dbt_prod_video_demographics_intermediate`
- View Type: Direct Table
- Data Source: prod.yt_reports_api.demographics_intermediate

## Impact Analysis Guide

### Making Changes Safely

1. **Before changing a database table:**
   - Check "Views by Data Source" section above
   - Identify all views that use the table
   - Review explores that depend on those views

2. **Before modifying a view:**
   - Check which models include the view
   - Review explores that use the view as base
   - Consider downstream reporting impact

3. **Before changing a model:**
   - Review all explores in the model
   - Check business usage of those explores
   - Coordinate with report consumers

### Complexity Indicators

- **High Line Count Views**: Complex business logic, may need optimization
- **Many Source Tables**: Complex joins, potential performance impact
- **Multiple Dependencies**: Changes have wide impact, need careful testing

