view: int_dbt_prod_stg_dim_playlist_spotify { sql_table_name: INTELLIGENCE.DBT_PROD.stg_dim_playlist_by_playlist_spotify ;; # dimension: playlistid { # type: number # sql: ${TABLE}.playlistid ;; # primary_key: yes # hidden: yes # } dimension: storeplaylistid { primary_key: yes #this is primary key type: number sql: ${TABLE}.storeplaylistid ;; hidden: yes } dimension: playlistauthor { label: "Author" type: string sql: ${TABLE}.playlistauthor ;; } dimension: playlistname { label: "Name" type: string sql: ${TABLE}.playlistname ;; } dimension: playlisturl { label: "URL" type: string sql: ${TABLE}.playlisturl ;; } dimension: storeid { label: "Store ID" type: number sql: ${TABLE}.storeid ;; } dimension: playlisturi { label: "URI" type: string sql: ${TABLE}.playlisturi ;; } # dimension: playlistimage { # label: "Image" # type: string # sql: ${TABLE}.playlistimage ;; # } # dimension: playlisttypename { # label: "Type" # type: string # sql: ${TABLE}.playlisttypename ;; # } # dimension: playlisttypeid { # label: "Type ID" # type: string # sql: ${TABLE}.playlisttypeid ;; # } dimension: is_editorial { type: yesno description: "Based off logic where the author is the same as the store - includes both playlists and stations" sql: (${TABLE}.storeid = 286 AND CONTAINS(${TABLE}.playlistauthor, 'spotify'));; } # dimension_group: createddatetime { # label: "Created" # description: "The date the playlist was first seen by The Orchard; Note: playlists seen prior to 2019-05-15 have the same Created Date" # type: time # sql: ${TABLE}.createddatetime ;; # timeframes: [year,quarter,month,week,date] # } # dimension_group: updateddatetime { # label: "Updated" # description: "The date the playlist's metadata was most recently updated; Note: playlists seen prior to 2019-05-15 have the same Updated Date" # type: time # sql: ${TABLE}.updateddatetime ;; # timeframes: [year,quarter,month,week,date] # } measure: count_playlists { label: "Number of Playlists" type: count_distinct sql: ${storeplaylistid} ;; } dimension: playlisttype { label: "Playlist Type" type: string hidden: yes sql: ${TABLE}.playlisttype ;; } dimension: playlist_type_normalised { label: "Playlist Type Normalized" description: "Playlist type classification derived from raw playlist types. Maps values such as User Generated , Editorial , Curated/3rd Party , Radio , Algorithmic, Chart, New Music Friday" type: string sql: ${TABLE}.playlist_type_normalised ;; } dimension: playlist_track_count { label: "Playlist Track count" type: number sql: ${TABLE}.playlisttrackcount ;; } dimension: playlist_follower_count { label: "Playlist Follower count" type: number sql: ${TABLE}.playlistfollowercount ;; } dimension: playlist_genre_list { label: "Playlist Genre List" type: string sql: ${TABLE}.playlist_genre_list ;; } }