view: int_dbt_prod_chartmetric_stats { sql_table_name: intelligence.dev_sgraig.spotify_dm_cm_stats_temp_20250612 ;; dimension: primary_key { primary_key: yes hidden: yes description: "Primary Key" sql: CONCAT(${TABLE}.isrc, ${TABLE}.artist_name, ${TABLE}.track_name,${TABLE}.label_name, ${TABLE}.genre, ${TABLE}.release_year, ${TABLE}.start_date, ${TABLE}.end_date, ${TABLE}.spotify_source, ${TABLE}.activity_date, ${TABLE}.streams, ${TABLE}.prev_doweek_streams, ${TABLE}.wtd_streams, ${TABLE}.prev_wtd_streams, ${TABLE}.post_dm_streams, ${TABLE}.pre_dm_streams, ${TABLE}.moving_14_day_avg,) ;; } dimension: ISRC { description: "The ISRC" view_label: "Track" type: string sql: ${TABLE}.isrc_cd ;; } dimension: label_name { description: "Label name associated with the ISRC" view_label: "Label" type: string sql: ${TABLE}.label_name ;; } dimension: artist_name { type: string view_label: "Artist" label: "Artist Name" description: "Artist Name corresponding to ISRC" sql: ${TABLE}.artist_name ;; } dimension: track_name { type: string view_label: "Track" label: "Track Name" description: "Track name corresponding to ISRC" sql: ${TABLE}.song_title ;; } dimension: genre { type: string view_label: "Release" label: "Genre" description: "Genre corresponding to ISRC" sql: ${TABLE}.genre ;; } dimension: release_year { type: string view_label: "Release" label: "Release Year" description: "Release year" sql: ${TABLE}.release_year ;; } dimension_group: start_date { view_label: "Date" label: "Start" type: time sql: ${TABLE}.start_date ;; description: "Start date of DM participation" timeframes: [year, quarter, month, week, date, day_of_year, day_of_week, week_of_year, month_name, month_num, fiscal_month_num, fiscal_quarter, fiscal_quarter_of_year, fiscal_year] } dimension_group: end_date { view_label: "Date" label: "End" type: time sql: ${TABLE}.end_date ;; description: "End date of DM participation" timeframes: [year, quarter, month, week, date, day_of_year, day_of_week, week_of_year, month_name, month_num, fiscal_month_num, fiscal_quarter, fiscal_quarter_of_year, fiscal_year] } dimension_group: snapshot_date { view_label: "Date" label: "Snapshot" type: time sql: ${TABLE}.snapshot_date ;; description: "The date when the chartmetric snapshot occured" timeframes: [year, quarter, month, week, date, day_of_year, day_of_week, week_of_year, month_name, month_num, fiscal_month_num, fiscal_quarter, fiscal_quarter_of_year, fiscal_year] } measure: Max_Activity_Date { view_label: "Date" label: "Max Activity Date" description: "The latest activity date for dimension being measured" type: date sql: MAX(${TABLE}.snapshot_date) ;; } measure: followers { type: sum view_label: "Spotify Social" label: "Followers" description: "Total followers" sql: ${TABLE}.followers ;; } measure: monthly_listeners { type: sum view_label: "Spotify Social" label: "Monthly Listeners" description: "Total streams on the same day in the previous week" sql: ${TABLE}.monthly_listeners ;; } }