view: int_dbt_prod_stg_dim_playlist_spotify { sql_table_name: INTELLIGENCE.DBT_PROD.STG_DIM_PLAYLIST_SPOTIFY ;; dimension: playlistid { type: number sql: ${TABLE}.playlistid ;; primary_key: yes hidden: yes } dimension: storeplaylistid { 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: ${playlistid} ;; } }