view: facts_prod_summary_sos { sql_table_name: facts.prod.summary_sos ;; dimension_group: download_activity_date { label: "Activity" view_label: "Date" type: time sql: ${TABLE}.download_activity_date ;; timeframes: [date, year, quarter, month] } dimension: labelid { label: "Label ID" view_label: "Label" type: number sql: ${TABLE}.labelid ;; value_format: "0" } dimension: subaccountid { label: "Subaccount ID" view_label: "Subaccount" type: number sql: ${TABLE}.subaccountid ;; value_format: "0" } dimension: artistid { label: "Artist ID" view_label: "Artist" type: number sql: ${TABLE}.artistid ;; value_format: "0" } dimension: isrc { label: "ISRC" view_label: "Track" type: string sql: ${TABLE}.isrc ;; } dimension: storeid { label: "Store ID" view_label: "Store" type: number sql: ${TABLE}.storeid ;; hidden: yes value_format: "0" } dimension: playlist_id { type: string sql: CASE ${TABLE}.storeid WHEN 1 THEN TRIM(SPLIT_PART(${TABLE}.playlist_url,'.',4)) WHEN 286 THEN TRIM(SPLIT_PART(${TABLE}.playlist_url,'/',5)) END ;; hidden: yes } dimension: playlist_url { label: "Playlist URL" view_label: "Playlist" type: string sql: ${TABLE}.playlist_url ;; } dimension: source_is_playlist { view_label: "Playlist" type: yesno sql: IFF(${TABLE}.playlist_url IS NULL OR LENGTH(${TABLE}.playlist_url) = 0, FALSE, TRUE) ;; } measure: streams_from_passive_discovery { label: "Streams from Discovery (Passive)" view_label: "Streams" type: sum sql: ${TABLE}.streams_from_passive_discovery ;; } measure: streams_from_active_discovery { label: "Streams from Discovery (Active)" view_label: "Streams" type: sum sql: ${TABLE}.streams_from_active_discovery ;; } measure: streams_from_collection { label: "Streams from Collection" view_label: "Streams" type: sum sql: ${TABLE}.streams_from_collection ;; } measure: overall_number_of_streams { label: "Overall Streams" view_label: "Streams" type: sum sql: ${TABLE}.overall_number_of_streams ;; } measure: count_playlists { label: "Playlists (Count)" view_label: "Playlist" type: count_distinct sql: ${TABLE}.playlist_url ;; } measure: count_isrcs { label: "Tracks (Count)" view_label: "Track" type: count_distinct sql: ${TABLE}.isrc ;; } # dimension: max_processed_timestamp_source { # type: date_time # sql: ${TABLE}.max_processed_timestamp_source ;; # } # dimension: processed_datetime { # type: date_time # sql: ${TABLE}.processed_datetime ;; # } }