# View: chartmetric_spotify_playlists

**View Name:** chartmetric_spotify_playlists
**Table Source:** `Derived from: Chartmetric.Raw_Data, Raw_Data.L_Spotify_Playlist, Raw_Data.Spotify_Playlist`
**File Path:** `views/chartmetric_spotify_playlists.view.lkml`

## Overview

- **File Size:** 6436 bytes
- **Lines of Code:** 210
- **Dimensions:** 19
- **Measures:** 1
- **Dimension Groups:** 2
- **Filters:** 0

## Comments & Notes

- =========================================================================
- PRIMARY KEYS & FOREIGN KEYS
- =========================================================================

## Dimensions

| Name | Type |
|------|------|
| `link_playlist_id` | string |
| `spotify_track_id_fk` | number |
| `playlist_pk_id` | number |
| `spotify_playlist_id` | string |
| `playlist_owner_name` | string |
| `playlist_position_latest` | number |
| `playlist_followers_latest` | number |
| `playlist_num_tracks_latest` | number |
| `playlist_country_code` | string |
| `playlist_category_id` | string |
| `playlist_format` | string |
| `playlist_is_active` | yesno |
| `playlist_is_public` | yesno |
| `playlist_is_personalized` | yesno |
| `playlist_is_collaborative` | yesno |
| `playlist_is_radio` | yesno |
| `playlist_url` | string |
| `playlist_name` | string |
| `playlist_or_release_type` | string |

## Measures

| Name | Type |
|------|------|
| `unique_playlist_count` | count_distinct |

## Dimension Groups

| Name | Type |
|------|------|
| `playlist_added` | time |
| `created_or_release` | time |

## Derived Table

```sql
sql:
      SELECT
        lp.ID AS link_playlist_id,
        lp.SPOTIFY AS spotify_track_id_fk,
        lp.ADDED_AT AS playlist_added_at,
        lp.POSITION_LATEST AS playlist_position_latest,
        lp.START_SYS_PERIOD AS playlist_start_sys_period,
        lp.END_SYS_PERIOD AS playlist_end_sys_period,
        p.ID AS playlist_pk_id,
        p.PLAYLIST_ID AS spotify_playlist_id,
        p.CATEGORY_ID AS playlist_category_id,
        p.USER_ID AS playlist_user_id,
        p.NAME AS playlist_name,
        p.URL AS playlist_url,
        p.DESCRIPTION AS playlist_description,
        p.OWNER_NAME AS playlist_owner_name,
        p.SPOTIFY_PLAYLIST_OWNER AS spotify_playlist_owner_id,
        p.FOLLOWERS_LATEST AS playlist_followers_latest,
        p.NUM_TRACK_LATEST AS playlist_num_tracks_latest,
        p.LAST_UPDATED AS playlist_last_updated,
        p.CODE2 AS playlist_country_code,
        p.PLAYLIST_UPDATED AS playlist_updated_at,
        p.PERSONALIZED AS playlist_is_personalized,
        p.PUBLIC AS playlist_is_public,
        p.COLLABORATIVE AS playlist_is_collaborative,
        p.RADIO AS playlist_is_radio,
        p.ACTIVE AS playlist_is_active,
        p.SNAPSHOT_ID AS playlist_snapshot_id,
        p.FORMAT AS playlist_format,
        p.CREATED_AT AS playlist_created_at,
        p.MODIFIED_AT AS playlist_modified_at
      FROM CHARTMETRIC.RAW_DATA.L_SPOTIFY_PLAYLIST lp
      INNER JOIN CHARTMETRIC.RAW_DATA.SPOTIFY_PLAYLIST p ON lp.SPOTIFY_PLAYLIST = p.ID
      WHERE p.NAME LIKE '%New Music Friday%'
        AND p.SPOTIFY_PLAYLIST_OWNER = 2
      ;;
```

