# View: dt_project_moments_uniti_graphical_representation

**View Name:** dt_project_moments_uniti_graphical_representation
**Table Source:** `Derived from: Dbt_Prod.Summary_Streams, Dbt_Prod_Project_Moments.Uniti_Recommends_Refined_Log_Table, Intelligence.Dbt_Prod, Intelligence.Dbt_Prod_Project_Moments, Summary_Streams`
**File Path:** `views/dt_project_moments_uniti_graphical_representation.view.lkml`

## Overview

- **File Size:** 1926 bytes
- **Lines of Code:** 79
- **Dimensions:** 2
- **Measures:** 2
- **Dimension Groups:** 3
- **Filters:** 0

## Dimensions

| Name | Type |
|------|------|
| `isrc` | string |
| `country_code` | string |

## Measures

| Name | Type |
|------|------|
| `sixty_day_marker` | sum |
| `streams` | sum |

## Dimension Groups

| Name | Type |
|------|------|
| `snapshot` | time |
| `latest_date_data` | time |
| `activity_date` | time |

## Derived Table

```sql
sql:
      with summary_streams as (
      select
      *
      from intelligence.dbt_prod.summary_streams
      where download_activity_date > current_date()-400
      and store = 'Spotify'
      group by all
      )


      select
          ur.snapshot_date as snapshot_date,
          ur.activity_date as latest_data_date,
          ss.download_activity_date as activity_date,
          iff(ss.download_activity_date = ur.snapshot_date - 60 , 1, 0) as sixty_day_marker,
          ss.isrc as isrc,
          ss.transaction_country_code as country_code,
          sum(ss.streams) as streams
      from summary_streams ss
      inner join intelligence.dbt_prod_project_moments.uniti_recommends_refined_log_table ur
          on ss.transaction_country_code = ur.transaction_country_code
              and ss.isrc = ur.isrc
      where
          ss.download_activity_date >= (ur.activity_date-180)
      group by all
    ;;
```

