view: int_dbt_prod_spotify_dm_postdm_lift_streams { sql_table_name: intelligence.dbt_prod_strategy.spotify_dm_postdm_lift_streams ;; 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 ;; } 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}.track_name ;; } 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: activity_date { view_label: "Date" label: "Activity" type: time sql: ${TABLE}.Activity_date ;; description: "The date when activity 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}.activity_date) ;; } measure: post_dm_streams { type: sum view_label: "Streams" label: "Post DM Streams" description: "Streams on all days since start of DM participation" sql: ${TABLE}.post_dm_streams ;; } measure: post_dm_lift_streams { type: sum view_label: "Streams" label: "Post DM Lift Streams" description: "Break-even streams required since beginning of DM participation" sql: ${TABLE}.post_dm_lift_streams ;; } }